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