Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
74 Views

OneAPI FPGA C Math Function Support

I have developing designs using the FPGA SDK for OpenCL using both the DevCloud and an on-premise solution. My designs have been fully compiled and executed without issue on either platform.

I have been exploring the use of dpcpp/OneAPI for FPGAs for the same designs I have developed with OpenCL. When compiling my dpcpp code for the CPU, the program compiles, executes, and the results are validated. When I target the FPGA emulator (-fintelfpga -DFPGA_EMULATOR), I receive the following compilation error:

 

Failed to build device program
Error: unimplemented function(s) used:
__svml_expf16 is undefined 
__svml_sqrtf16_mask is undefined 
__svml_sqrtf16 is undefined 
CompilerException Failed to parse IR
Error: Compiler Error: OpenCL kernel compile/link FAILED
clang++: error: fpga compiler command failed with exit code 1 (use -v to see invocation)

 

 

My kernel uses the C math functions exp(), sqrt(), and pow(). When removing the exp() and sqrt() functions, the program compiles fine and the FPGA emulation completes successfully. Is there something I am missing to include for the FPGA like oneMKL or is there a missing FPGA implementation for the exp() and sqrt() functions?

Any help would be appreciated. All of the OneAPI development is performed on the DevCloud. DPCPP version: 

 

Intel(R) oneAPI DPC++ Compiler 2021.1-beta07 (2020.5.0.0604)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /glob/development-tools/versions/oneapi/beta07/inteloneapi/compiler/latest/linux/bin

 

 

Thank you!

2 Replies
Highlighted
Moderator
57 Views

Re:OneAPI FPGA C Math Function Support

Hi,


You can refer to https://www.oneapi.com/ -> https://spec.oneapi.com/versions/latest/elements/oneMKL/source/domains/vm/sqrt.html?highlight=sqrt


If you had follow the syntax and still see the problem. Attached the files and steps for us for duplication.


Thanks,


0 Kudos
Highlighted
Beginner
48 Views

Re: Re:OneAPI FPGA C Math Function Support

Hi,

I see that according to the oneMKL source (GitHub) that FPGA accelerators are not supported. 

Like I mentioned previously, the code runs fine when the compile target is the CPU only. 

I cannot disclose the actual source; however, I have created a simple program that produces the same error. The file mathfunc.cpp contains a similar routine using the exp(), sqrt(), and pow() C math functions. 

Compile for CPU (throws no error) using: 

 

dpcpp -DCPU_HOST mathfunc.cpp -o program

 

Compile for FPGA Emulator using:

 

dpcpp -fintelfpga -DFPGA_EMULATOR mathfunc.cpp -o program

 

Which gives the error:

 

Failed to build device program
Error: unimplemented function(s) used:
__svml_expf16 is undefined 
__svml_sqrtf16 is undefined 
CompilerException Failed to parse IR
Error: Compiler Error: OpenCL kernel compile/link FAILED
clang++: error: fpga compiler command failed with exit code 1 (use -v to see invocation)

 

 To execute CPU or FPGA Emulator program:

 

./program

 

Thank you!

Note: I had to zip the source file in order to upload.

0 Kudos