Error Message "error: out of jump/jumpc imm range" Is Displayed During Kernel Compilation
Symptom
The project-based operator development mode is used based on the custom operator project. The operator fails to be compiled, and the following error is reported:
1 | [ERROR] [ascendxxxx] PowerCustom_88a695f03edfbc0af76b9eaae9e4556c error: out of jump/jumpc imm range |
Cause Analysis
The cause of the compilation error is that the code of the operator kernel is too large. As a result, the offset value of the jump instruction exceeds the specified value (value range of int16_t) during compilation. You can add the compilation option -mllvm -cce-aicore-jump-expand=true to avoid this problem and ensure that the compiler can function properly.
Solution
- In CMakeLists of the kernel, use add_ops_compile_options to add the compilation option -mllvm -cce-aicore-jump-expand=true for the operator that reports the error. The following is an example:
add_ops_compile_options(PowerCustom OPTIONS -mllvm -cce-aicore-jump-expand=true)
For details about how to use add_ops_compile_options, see Supported Customization Options.
- Recompile the operator. The compilation is normal and no error is reported.
Parent topic: FAQ