Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Daniel_D
Beginner
139 Views

use openmp offloading

Hi,

 

I try to make use of the openmp offloadind feature. Unfortunatley I get some strange error messages when I try to compile. (Windows 10):

 

Here are the command line options I use:

/Yu"stdafx.h" /GS /fsycl /Qiopenmp /W3

/fsycl-targets=spir64_gen-unknown-unknown-sycldevice /Zi /O2 /Qopenmp-targets:spir64

/Qipo /Zc:forScope /MD /std:c++17 /Fa"x64\Release\" /EHsc /nologo /Fo"x64\Release\" //fprofile-instr-use "x64\Release\" /Fp"x64\Release\AlgoGPU.pch"

I remove the /I and /D

 

This is what I get during compilation:

 

1>error: Enables or disables Intel Compiler compatibility mode was enabled in PCH file but is currently disabled
1>error: PCH file was compiled for the target 'x86_64-pc-windows-msvc19.28.29914' but the current translation unit is being compiled for target 'spir64_gen-unknown-unknown-sycldevice'
1>2 errors generated.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Platforms\x64\PlatformToolsets\Intel C++ Compiler 2021\Toolset.targets(199,5): error MSB6006: "icx.exe" exited with code 1.

 

 

Does anyone know what I'm doing wrong?

 

Thanks,

Daniel

 

 

 

 

0 Kudos
4 Replies
NoorjahanSk_Intel
Moderator
102 Views

Hi,

Thanks for reaching out to us.

 

Could you please try your code using below command line option with oneAPI DPC++/ icx compilers

-fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice /std:c++17 /O2 /Zc:forScope /MD /Qiopenmp /Qopenmp-targets=spir64

 

 

and also provide the following details:

compiler version

GPU that you are using if any.

 

Thanks & Regards

Noorjahan.

 

NoorjahanSk_Intel
Moderator
68 Views

Hi,

Reminder:

Could you please confirm whether your issue is resolved. If not please provide the above mentioned details.


Thanks & Regards

Noorjahan


Daniel_D
Beginner
58 Views

Hi Noorjahan,

 

sorry fort my late reply, but I'm busy with a different project. I tried you suggestion and it does not work.

I use VS2019 community edition as my IDE on Windows 10. I use CUDA for my main work, but want to use the Intewl CPOU internal gpu to accelerate other smaller calculations.

I can get my project compiled without offloading with the "Intel C++ Compiler 2021". If I switch to the oneAPI DPC++ compiler I see serveral issues:

In the VS2019 project there is no indication that I use the intel DPC++ compiler. In general you see in brackets the compiler if you do not use the VS2019 default. That works for all other toolsets I use - except the Intel DPC++. Nothing in brackets - looks the same as I use v142.

 

Here are some of the compiler errors I see:

1>In file included from T:\TFS-TradeProject\3rdParty\boost_1_75_0\boost/thread/detail/platform.hpp:17:
1>T:\TFS-TradeProject\3rdParty\boost_1_75_0\boost/config/requires_threads.hpp(82,4): : error : "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"
1># error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"
1> ^
Studio\2019\Community\VC\Tools\MSVC\14.28.29910\atlmfc\include\atlsocket.h:26:
1>In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\atlmfc\include\atlconv.h:27:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\atlmfc\include\atlalloc.h(620,5): : error : SEH '__try' is not supported on this target
1> __try
1> ^
1>In file included from T:\\TFS-TradeProject\\TT-Miner\\TT-MinerAlgos\\AlgoShared\CudaKernel2.h:2:
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(1136,15): : warning : '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
1>typedef void (CUDA_CB *CUhostFn)(void *userData);
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(1127,17): note: expanded from macro 'CUDA_CB'
1>#define CUDA_CB __stdcall
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(1829,15): : warning : '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
1>typedef void (CUDA_CB *CUstreamCallback)(CUstream hStream, CUresult status, void *userData);
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(1127,17): note: expanded from macro 'CUDA_CB'
1>#define CUDA_CB __stdcall
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(1837,17): : warning : '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
1>typedef size_t (CUDA_CB *CUoccupancyB2DSize)(int blockSize);
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(1127,17): note: expanded from macro 'CUDA_CB'
1>#define CUDA_CB __stdcall
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(2975,10): : warning : '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
1>CUresult CUDAAPI cuGetErrorString(CUresult error, const char **pStr);
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(2939,17): note: expanded from macro 'CUDAAPI'
1>#define CUDAAPI __stdcall
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(2996,10): : warning : '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
1>CUresult CUDAAPI cuGetErrorName(CUresult error, const char **pStr);
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(2939,17): note: expanded from macro 'CUDAAPI'
1>#define CUDAAPI __stdcall
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(3030,10): : warning : '__stdcall' calling convention is not supported for this target [-Wignored-attributes]
1>CUresult CUDAAPI cuInit(unsigned int Flags);
1> ^
1>C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2\\include\cuda.h(2939,17): note: expanded from macro 'CUDAAPI'
1>#define CUDAAPI __stdcall

 

Does that help?

 

Daniel

NoorjahanSk_Intel
Moderator
31 Views

Hi,

Could you please provide us a sample reproducer and steps to reproduce it. So that, we can try it from our end.

 

Thanks & Regards

Noorjahan

 

Reply