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

OpenMP pragma: omp smid not recognized by dpcpp

Tomasoni
Novice
796 Views

Hello all.

dpcpp compiler is warning me about a missing omp directive

```

matrixLib.c:395:14: error: expected an OpenMP directive
#pragma omp smid
^

```

 

in the following code

```

...

#pragma omp smid
for(int i=start; i<=end ; i += step)
   out_vector[midx++] = i;

```

But I read here

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/optimization-and-programming/openmp-support/openmp-pragmas.html

 

that omp smid directive is supported.

this works if compiled with gcc-9 or g++-9

 

Can you explain me what is the right directive with dpcpp?

Thanks

Danilo

Labels (1)
0 Kudos
4 Replies
VarshaS_Intel
Moderator
770 Views

Hi,

 

Thanks for posting in Intel Communities.

 

Could you please try using the 'pragma omp simd' since it is a supported directive with the dpcpp compiler? Please find the below link:

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/optimization-and-programming/openmp-support/openmp-pragmas.html

We have tried a sample code and it worked without any errors. Please find the below screenshot:

VarshaS_Intel_0-1658751835356.png

>>that omp smid directive

Could you please elaborate on how to use 'pragma omp smid'?

 

And also, could you please let us know the Intel DPCPP compiler version, OS details, and sample reproducer code to investigate more on your issue?

 

Thanks & Regards,

Varsha

 

0 Kudos
VarshaS_Intel
Moderator
744 Views

Hi,


We have not heard back from you. Could you please provide an update on your issue?


Thanks & Regards.

Varsha


0 Kudos
Tomasoni
Novice
725 Views

Hello, thank you for your answer. I think I was missing `-qopenmp` while compiling with dscpp

I couldn't find this in the docs.

Thank you!

0 Kudos
VarshaS_Intel
Moderator
709 Views

Hi,


Could you please find the below link where we are able to compile and run OpenMP code with dpcpp compiler:

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/software-development-process/composability/c-c-openmp-and-dpc-composability.html

 

>> thank you for your answer

Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Varsha


0 Kudos
Reply