---
title: aclmdlRIKernelTaskGetAttribute
description: "须知：本接口为试验特性，后续版本可能会存在变更，不支持应用于生产环境中。"
url: https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/latest/API/runtimeapi/aclcppdevg_03_2206.html
sourcePath: /source/zh/CANNCommunityEdition/920beta1/API/runtimeapi/aclcppdevg_03_2206.html
indexId: 597e2776d400834ff780482402cd282fbbd7b1d4da6878c01e1cb3aa9b75a33579
---
# aclmdlRIKernelTaskGetAttribute

须知：本接口为试验特性，后续版本可能会存在变更，不支持应用于生产环境中。

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Ascend 950PR / Ascend 950DT | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | ☓ |
| Atlas 推理系列产品 | ☓ |
| Atlas 训练系列产品 | ☓ |


#### 功能说明

查询Cube Core和Vector Core上计算任务的属性配置。

在调用本接口之前，请先使用aclmdlRIGetTasksByStream(https://gitcode.com/cann/runtime/blob/e0f7108a4c4d22b436e168b2783b99fe2fc157d9/docs/03_api_ref/15_模型运行实例管理.md#aclmdlRIGetTasksByStream)接口获取指定Stream中的所有任务，然后使用aclmdlRITaskGetType接口确认当前的任务是Cube Core和Vector Core上的计算任务，再调用本接口查询具体的属性配置。


#### 函数原型

```
aclError aclmdlRIKernelTaskGetAttribute(aclmdlRITask task, aclrtLaunchKernelAttrId attrId, aclrtLaunchKernelAttrValue *attrValue)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| task | 输入 | 指定任务。类型定义请参见aclmdlRITask。 |
| attrId | 输入 | 要查询的属性ID。类型定义请参见aclrtLaunchKernelAttrId。 不支持查询ACL\_RT\_LAUNCH\_KERNEL\_ATTR\_ENGINE\_TYPE（表示算子执行引擎）、ACL\_RT\_LAUNCH\_KERNEL\_ATTR\_BLOCKDIM\_OFFSET（表示numBlocks偏移量）、ACL\_RT\_LAUNCH\_KERNEL\_ATTR\_BLOCK\_TASK\_PREFETCH（表示任务下发时是否阻止硬件预取本任务的信息）。 |
| attrValue | 输出 | 查询出的属性值。类型定义请参见aclrtLaunchKernelAttrValue。 |


#### 返回值说明

返回0表示成功，返回其他值表示失败，请参见aclError。


#### 约束说明

对于同一个模型运行实例，本接口不支持并发调用。
