Hello again,
I've tried to run the same full code on FPGA Arria 10 OneAPI devcloud fpga_emulation, and FPGA hardware. The emulation worked normally and successfully and gave satisfying results as shown in the first picture. Running it on FPGA gave me incredible bad results compared to the emulation as the (distance_calculation_FPGA) in emulation resulted in 0.03 seconds and started to decrease, but on FPGA it was 3.5 seconds, and then segmentation fault as in the second picture.
The command I used for the emulation was:
1. dpcpp -fintelfpga -DFPGA_EMULATOR fpga_compile.cpp -o fpga_compile.fpga_emu
2. ./fpga_compile.fpga_emu
and for FPGA hardware:
1. dpcpp -fintelfpga -Xshardware fpga_compile.cpp -o fpga_compile.fpga
2. ./fpga_compile.fpga