__trap
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Calling this API in the SIMT VF implementation code will interrupt the execution of an operator. This API is applicable to debug abnormal scenarios on the kernel side.
Prototype
1 | __simt_callee__ inline void __trap() |
Parameters
None
Returns
None
Restrictions
None
Header Files to Be Included
To use this API, the utils/debug/asc_assert.h header file must be included.
1 | #include "utils/debug/asc_assert.h" |
Examples
1 2 3 4 5 6 7 8 | __simt_vf__ __launch_bounds__(1024) inline void SimtKernel(__gm__ bool* dst, __gm__ float* x) { int idx = threadIdx.x + blockIdx.x * blockDim.x; if (isnan(x[idx])) { __trap(); } dst[idx] = x[idx]; } |
Parent topic: Commissioning APIs