Issues with the use of the flag "-fintelfpga"
Hello!
We are trying to use the emulator to check the results of an algorithm and we have found that the execution fails when we use the "-fintelfpga" flag.
The running example is a simple "triad" that implements two SYCL queues to heterogeneously perform the C=A+alpha*B operation splitting the computation between the CPU and FPGA. To launch the compilation and execution we use the following script:
#!/bin/bash
rm -rf *.o *.d *.out *.mon *.emu *.aocr *.aoco *.prj *.fpga_emu *.a triadd-sycl-gpu
source /opt/intel/inteloneapi/setvars.sh > /dev/null
rm triadd-sycl-emu
dpcpp src/main.cpp src/kernel.cpp -o triadd-sycl-emu -DFPGA_EMULATOR
sleep 1
./triadd-sycl-emuUp to this point we don't have any problem and the execution works using the s001-n147 compilation node in interactive mode:
u37462@s001-n147:~/triadd$ ./triadd-sycl-emu
Experiment: 32 elements, offload-ratio 0.5
Device: Intel(R) FPGA Emulation Device
CPU: Intel(R) Xeon(R) Platinum 8153 CPU @ 2.00GHz
RESULT: 0.000 1.500 3.000 4.500 6.000 7.500 9.000 10.500 12.000 13.500 15.000 16.500 18.000 19.500 21.000 22.500 24.000 25.500 27.000 28.500 30.000 31.500 33.000 34.500 36.000 37.500 39.000 40.500 42.000 43.500 45.000 46.500
CPU: Heterogenous triad correct.
Kernel: 1.05579 s
Total: 1.05587 sThen, adding the flag "-fintelfpga" to the compilation, as it is recommended to use in BaseKit-code-samples of the "Get started with the Intel oneAPI Base Toolkit on the DevCloud", there is no compilation error but we get the following execution error at runtime:
u37462@s001-n147:~/triadd$ ./triadd-sycl-emu
Experiment: 32 elements, offload-ratio 0.5
Device: Intel(R) FPGA Emulation Device
CPU: Intel(R) Xeon(R) Platinum 8153 CPU @ 2.00GHz
terminate called after throwing an instance of 'cl::sycl::runtime_error'
what(): OpenCL API failed. OpenCL API returns: -42 (CL_INVALID_BINARY) -42 (CL_INVALID_BINARY)
AbortedLooking at the link stages with the "-v" flag, we have seen that the only difference of adding "-fintelfpga" is that the target for “clang-offload-wrapper” changes from “spir64” to “spir64_fpga”. This may be one of the sources of errors we are having when compiling for FPGA.
Also, when we are not in interactive mode and we send the compilation to a queue without "-fintelfpga" we get this permission warning:
/var/spool/torque/mom_priv/epilogue.parallel: line 12: /var/spool/torque/mom_priv/epilogue.d//95-nvdir.epilogue: Permission deniedHowever, there are no errors when executing.
We would really appreciate any help!
Greetings.