kupl_set_kernel_concurrency
Sets the global concurrency level of the memcpy kernel.
Interface Definition
void kupl_set_kernel_concurrency(int num);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
num |
int |
Kernel concurrency value to be set Constraint: 1 ≤ num ≤ kupl_get_num_executors(). If the input is not within the constraint range, num is internally set to the value returned by kupl_get_num_executors(). |
Input |
Examples
1 2 3 4 5 6 7 8 9 10 | #include <stdio.h> #include "kupl.h" int main() { kupl_set_kernel_concurrency(2); int num = kupl_get_kernel_concurrency(); printf("kupl kernel concurrency = %d\n", num); return 0; } |
The execution result is as follows:
kupl kernel concurrency = 2
- The preceding example demonstrates how to set and print the global kernel concurrency value. The preceding kupl_set_kernel_concurrency function sets the kernel concurrency level to 2.
- Alternatively, you can also specify the kernel concurrency level using the KUPL_KERNEL_CONCURRENCY environment variable instead of calling the kupl_set_kernel_concurrency API.
Parent topic: Memory Management Functions