---
title: HTL_thread_executor_get_cpubind
description: "获取执行器绑定的目标CPU。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/252RC1/accel/kunpengaccel_ksl_16_0067.html
sourcePath: /source/zh/kunpengboostkithistory/252RC1/accel/kunpengaccel_ksl_16_0067.html
indexId: a7f35277121a582407fb9c992eb2a424b2a508a1527043c97596cf228ec5dead76
---
# 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);
```
