---
title: HTL_is_cpu_in_same_numa
description: "判断CPU是否属于同一个NUMA。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0148.html
sourcePath: /source/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0148.html
indexId: ad92c6bf27d9800cd35766439b443b9d537079980bb1f969799296a7d1e245b474
---
# HTL_is_cpu_in_same_numa

判断CPU是否属于同一个NUMA。

#### 接口定义

bool HTL_is_cpu_in_same_numa(int i, int j);


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| i | int | CPU索引号。 | 输入 |
| j | int | CPU索引号。 | 输入 |


#### 返回值

- true：属于相同NUMA。
- false：不属于相同NUMA。


#### 示例

```
bool same = HTL_is_cpu_in_same_numa(cpu, cpu + 1);
```
