---
title: kpccl_set_kernel_concurrency_local
description: "设置当前线程的算子并发度。"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/KunoengHPCKit_developer_048.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/KunoengHPCKit_developer_048.html
indexId: 37b5c6cbdf55468f3b1351792db558ee9d7a4fa2e0162be342db6d1f13c0bfa473
---
# kpccl_set_kernel_concurrency_local

设置当前线程的算子并发度。

#### 接口定义

void kpccl_set_kernel_concurrency_local(int num);


#### 参数


**表1 参数定义**

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| num | int | 需要设置的当前线程的算子并发度的值 约束：1≤num≤kpccl\_get\_num\_executors()；当输入不在约束范围内时，内部设置num为kpccl\_get\_num\_executors() | 输入 |


#### 示例

```
#include <stdio.h>
#include "kpccl.h"
int main()
{
kpccl_set_kernel_concurrency_local
(2);
int num = kpccl_get_kernel_concurrency_local();
printf("local kpccl kernel concurrency = %d\n", num);
return 0;
}
```

运行结果如下。

```
local kpccl kernel concurrency = 2
```

- 上述示例设置并打印了当前线程的算子并发度的值。
- 上述kpccl_set_kernel_concurrency_local函数将算子并发度设置为2。
