---
title: 函数：launch_kernel_with_config
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_1094.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_1094.html
indexId: 5ab6e2653552db7da7770487c8fd6c0ca108540cecf9ddeb2b04e9b018ca1b7371
---
# 函数：launch_kernel_with_config

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

指定任务下发的配置信息，并启动对应算子的计算任务。异步接口。

若使用本接口下发AI Core算子的计算任务，需配套使用acl.rt.binary_load_from_file接口加载并解析算子二进制文件。


#### 函数原型

- C函数原型
  1 aclError aclrtLaunchKernelWithConfig(aclrtFuncHandle funcHandle, uint32_t numBlocks, aclrtStream stream, aclrtLaunchKernelCfg *cfg, aclrtArgsHandle argsHandle, void *reserve)

- python函数
  1 ret = acl.rt.launch_kernel_with_config(func_handle, num_blocks, stream, cfg, args_handle, reserve)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| func\_handle | int，核函数句柄。 |
| num\_blocks | int，指定核函数将会在几个核上执行。 |
| stream | int，指定执行任务的Stream。 |
| cfg | list，任务下发的配置信息。不指定配置时，此处可传空列表。list中每个元素的数据类型为字典，具体请参见aclrtLaunchKernelCfg。 |
| args\_handle | int，参数列表句柄。 |
| reserve | int，预留参数。当前固定传0。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，返回0表示成功，返回其他值表示失败。 |
