Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
701 Discussions

Device Selector Compilation Error

jbick819
New Contributor I
1,669 Views

Hello,

 

Prior to the latest oneAPI update, I had been creating my device selector in the following way:

#if defined(FPGA_EMULATOR)
    sycl::ext::intel::fpga_emulator_selector device_selector;
#elif defined(CPU_HOST)
    sycl::host_selector device_selector;
#else
    sycl::ext::intel::fpga_selector device_selector;
#endif
    
sycl::queue q(device_selector, sycl::property::queue::enable_profiling{});

 Things had been working just fine up until today, 5/4. I adjusted the code following deprecation warnings and a compilation error to follow the new method:

#if FPGA_SIMULATOR
	auto selector = sycl::ext::intel::fpga_simulator_selector_v;
#elif FPGA_HARDWARE
	auto selector = sycl::ext::intel::fpga_selector_v;
#else  // #if FPGA_EMULATOR
	auto selector = sycl::ext::intel::fpga_emulator_selector_v;
#endif

sycl::queue q(selector, sycl::property::queue::enable_profiling{});

However, I am still getting errors when I try and compile my code with this new device selector method. My compilation command is as follows:

icpx -fsycl -qactypes -fintelfpga -DFPGA_EMULATOR src/test.cpp -O3 -o bin/test

I ran the setvars script before attempting compilation as well:

source /opt/intel/oneapi/setvars.sh > /dev/null 2>&1

The error that I am getting is this:

OpenCL platform ID is empty
OpenCL platform name is empty
Failed to find any of these OpenCL platforms:
  Intel(R) FPGA Emulation Platform for OpenCL(TM)
  Intel(R) FPGA Emulation Platform for OpenCL(TM) (preview)
llvm-foreach: 
icpx: error: fpga compiler command failed with exit code 14 (use -v to see invocation)

 

Any ideas on how to fix this issue would be greatly appreciated, thank you!

0 Kudos
1 Solution
jbick819
New Contributor I
1,569 Views

My apologies everyone, it seems I have the incorrect Intel forum, I meant for this to be in the Intel Devcloud forum

View solution in original post

0 Kudos
4 Replies
xwuupb
Novice
1,631 Views

@jbick819 wrote:
#if FPGA_SIMULATOR
	auto selector = sycl::ext::intel::fpga_simulator_selector_v;
#elif FPGA_HARDWARE
	auto selector = sycl::ext::intel::fpga_selector_v;
#else  // #if FPGA_EMULATOR
	auto selector = sycl::ext::intel::fpga_emulator_selector_v;
#endif

sycl::queue q(selector, sycl::property::queue::enable_profiling{});

 


The code above should be "#ifdef FPGA_EMULATOR" (note the bold ifdef).

0 Kudos
jbick819
New Contributor I
1,602 Views

Thank you for the suggestion, however, this unfortunately did not solve my issue. As reference, I'm just following the Intel documentation for the new way to use the device selector as seen through this link:

https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/2023-1/device-selectors-for-fpga.html 

I did initially miss the note to make use of "defined" with the if statements, and thus changed the code to: 

#if defined(FPGA_SIMULATOR) and #elif defined(FPGA_HARDWARE)

0 Kudos
jbick819
New Contributor I
1,570 Views

My apologies everyone, it seems I have the incorrect Intel forum, I meant for this to be in the Intel Devcloud forum

0 Kudos
hareesh
Employee
1,478 Views

As we do not receive any response from you on the previous question/reply/answer that we have provided. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


0 Kudos
Reply