Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel ICX Compiler , Intel® DPC++ Compatibility Tool, and GDB*
560 Discussions

CMake cannot generate working EXE/DLL for Windows with DPC++

AJIOB
Novice
1,610 Views

I'm using Intel oneAPI BaseKit 2022.1.2 (w_BaseKit_p_2022.1.2.154_offline.exe), VisualStudio 2022 17.0.6 LTS, CMake 3.22.2, Ninja 1.10.2, VSCode 1.64.2, Windows 10 Pro 21H1 x64 English.

 

OneAPI & VisualStudio was fully reinstalled today.

 

I'm using a basic example loop unrolling.

 

Using VisualStudio sln works correctly & exe file starts to execute.

 

Using CMakeLists.txt (file attached), executable file doesn't work correctly & prints error -46 (CL_INVALID_KERNEL_NAME). CMakeLists file content is based on that link & default provided file. An example of error was screened below.

AJIOB_0-1646126006006.png

 

Build log was attached too:

  • from VSCode with Intel oneAPI plugins pack
  • from clear CMD with manually called setvars.bat file

 

I need to use CMakeLists.txt for cross-compile code building.

 

That error looks like a linking error. How cal I fix it?

 

With regards,
Alex

 

P.S. Project for reproducing an error was attached too.

Labels (1)
0 Kudos
2 Replies
SantoshY_Intel
Moderator
1,557 Views

Hi,

 

Thanks for reaching out to us.

 

We were able to reproduce your issue at our end using the Intel oneAPI Base Toolkit 2022.1.0 on the windows command prompt as seen in the attached screenshot(error.png) below.

 

We are working on your issue and we will get back to you soon.

 

Thanks & Regards,

Santosh

 

 

0 Kudos
Khalik_K_Intel
Moderator
1,481 Views

Hello,


Thank you for contacting Intel Support forum.

We have looked into your case.


This looks like a bug in usage of cmake with Intel oneAPI DPC++ compiler.

I have now forwarded this case to Intel development team for investigation.

I will update this forum once there is a feedback from Intel development team.


Please note that that this project may be successfully used from Visual Studio.

Moreover, you may compile the sources manually from the command line,

but without usage of cmake (I saw you statement that you need cmake - but maybe this would be suitable for you work on some other project, etc.):


>icx -fsycl /EHsc ..\src\loop-unroll.cpp

>loop-unroll.exe

Input array size: 33554432

Running on device: Intel(R) Graphics [0x3ea0]

Unroll factor: 1 Kernel time: 6685.64 ms

Throughput for kernel with unroll factor 1: 0.005 GFlops

Unroll factor: 2 Kernel time: 4171.452 ms

Throughput for kernel with unroll factor 2: 0.008 GFlops

Unroll factor: 4 Kernel time: 2332.509 ms

Throughput for kernel with unroll factor 4: 0.014 GFlops

Unroll factor: 8 Kernel time: 1441.188 ms

Throughput for kernel with unroll factor 8: 0.023 GFlops

Unroll factor: 16 Kernel time: 1252.165 ms

Throughput for kernel with unroll factor 16: 0.027 GFlops

PASSED: The results are correct.


Hope that this helps.

Regards,

Khalik.


0 Kudos
Reply