aclrtLaunchKernelAttrValue
1 2 3 4 5 6 7 8 9 10 11 | typedef union aclrtLaunchKernelAttrValue { uint8_t schemMode; uint32_t dynUBufSize; aclrtEngineType engineType; uint32_t blockDimOffset; uint8_t isBlockTaskPrefetch; uint8_t isDataDump; uint16_t timeout; aclrtTimeoutUs timeoutUs; uint32_t rsv[4]; } aclrtLaunchKernelAttrValue; |
The members are described as follows:
- schemMode
The options are as follows:
- 0: common scheduling mode. If there is an idle core, the operator execution is started. For example, if numBlocks is set to 8, the operator kernel function will be executed on eight cores. If the common scheduling mode is specified, the operator execution is started as long as one core is idle.
- 1: batch scheduling mode. The operator execution is started only when all required cores are idle. For example, if numBlocks is set to 8, the operator kernel function will be executed on eight cores. If the batch scheduling mode is specified, the operator execution is started only when all the eight cores are idle.
- dynUBufSize
Size of the dynamic Unified Buffer (UB) required for executing the Single Instruction Multiple Threads (SIMT) operator, in bytes. For pure SIMD operators, this parameter can only be set to 0.
You can obtain the maximum value of the dynUBufSize parameter by calling aclrtFunctionGetAvailDynUbufPerBlock.
Only the
Ascend 950PR /Ascend 950DT supports this parameter. - engineType
Operator execution engine. For details about the type definition, see aclrtEngineType.
Only the
Atlas inference product supports this parameter. - blockDimOffset
Offset of numBlocks. Number of cores on which the kernel function will be executed. The kernel function is used by numBlocks to specify the operator.
Only theAtlas inference product supports this parameter.- numBlocks ≤ Number of AI Cores: Computation on the Vector Core is not required. In this case, set engineType to ACL_RT_ENGINE_TYPE_AIC (indicating computation on the AI Core) and set blockDimOffset to 0.
- numBlocks > AI Core cores:
- Deliver a task in a stream, set engineType to ACL_RT_ENGINE_TYPE_AIC (indicating computation on the AI Core), and set blockDimOffset to 0.
- Deliver a task in another stream, set engineType to ACL_RT_ENGINE_TYPE_AIV (indicating computation on the Vector Core), and set blockDimOffset to aicorenumBlocks. The formula for calculating aicorenumBlocks is as follows:
- If numBlocks ≤ Number of AI Cores + Number of Vector Cores, then aicorenumBlocks = Number of AI Cores.
- Otherwise, aicorenumBlocks = Roundup (numBlocks x Number of AI Cores)/(Number of AI Cores + Number of Vector Cores).
- isBlockTaskPrefetch
Whether to block hardware from prefetching the information of the current task when the task is issued. The options are 0 (does not block prefetching) and 1 (blocks prefetching).
- isDataDump
Whether to enable dump. The options are 0 (disabled) and 1 (enabled).
- timeout
Timeout interval for the task scheduler to wait for task execution. This parameter applies only to the scenario where the AI CPU or AI Core operator is executed.
The options are as follows:
- 0: permanent waiting
- > 0: Specific timeout, in seconds.
- timeoutUs
Timeout interval for the task scheduler to wait for task execution, in microseconds. For details about the type definition, see aclrtTimeoutUs.
If both timeoutLow and timeoutHigh in the aclrtTimeoutUs structure are set to 0, it indicates forever waiting.
For the same launch kernel task, timeoutUs and timeout cannot be configured at the same time. Otherwise, an error is returned.
- rsv