aclrtGetFuncBySymbol
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
☓ |
|
√ |
|
☓ |
Function
Obtains a kernel function handle based on the kernel function name (function name declared by __global__, for example, myKernel).
This API is used only when a custom operator is developed using the Ascend C language and the host and device code is compiled together using the BiSheng compiler. It is not applicable to the scenario where the operator binary file is directly loaded.
After customizing a kernel function on the device, you can use this API to locate the corresponding kernel function in the internal symbol table based on the kernel function name. The returned funcHandle can be used for subsequent kernel launch.
Prototype
1 | aclError aclrtGetFuncBySymbol(const void *symbol, aclrtFuncHandle *funcHandle); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
symbol |
Input |
Kernel function name. |
funcHandle |
Output |
Kernel function handle. For details about the type definition, see aclrtFuncHandle. |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
- This API only applies to static shape scenarios of AI Core operators.
- The kernel function handle is valid only for the current device. After the device is switched, you need to obtain the handle again.