---
title: HTL_thread_executor_get_cpubind
description: "获取执行器绑定的目标CPU。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0067.html
sourcePath: /source/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0067.html
indexId: b9bff539611e54edd648cbfb02b65a99ab836e695fbcd0fd152deaa65e93bb0674
---
# HTL_thread_executor_get_cpubind

获取执行器绑定的目标CPU。

#### 接口定义

int HTL_thread_executor_get_cpubind(HTL_thread_executor_t executor, int *cpuid);


#### 描述

HTL_thread_executor_get_cpubind()返回执行器绑定目标CPU的CPU ID，若执行器绑定多个CPU，CPU ID将返回其中一个。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| executor | HTL\_thread\_executor\_t | 执行器句柄。 | 输入 |
| cpuid | int \* | CPU ID。 | 输出 |


#### 返回值

- HTL_THREAD_SUCCESS：成功。
- 其他：失败。见错误码定义。


#### 示例

```
int cpuid = -1;
HTL_thread_executor_t executor;
ret = HTL_thread_executor_self(&executor);
ret = HTL_thread_executor_get_cpubind(executor, &cpuid);
```
