Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
801 ディスカッション

use of undeclared identifier 'cl' error in example set

mnt
新規コントリビューター I
3,302件の閲覧回数

Hello,

I have followed openmp_reduction example to test host/gpu execution. However, the following commands don't produce the binary file because of the compilation error.

 

u187665@login-2:build$ qsub  -I  -l nodes=1:gpu:ppn=2 -d .
qsub: waiting for job 2248101.v-qsvr-1.aidevcloud to start
qsub: job 2248101.v-qsvr-1.aidevcloud ready


########################################################################
#      Date:           Sun 12 Mar 2023 10:50:48 AM PDT
#    Job ID:           2248101.v-qsvr-1.aidevcloud
#      User:           u187665
# Resources:           cput=75:00:00,neednodes=1:gpu:ppn=2,nodes=1:gpu:ppn=2,walltime=06:00:00
########################################################################

u187665@s019-n008:build$ pwd
/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build
u187665@s019-n008:build$ ls
u187665@s019-n008:build$ cmake ..
-- Default CMAKE_BUILD_TYPE not set using Release
-- The CXX compiler identification is Clang 16.0.0
-- Check for working CXX compiler: /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin/icpx
-- Check for working CXX compiler: /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin/icpx -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build
u187665@s019-n008:build$ make VERBOSE=1
/usr/bin/cmake -S/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction -B/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/CMakeFiles /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build'
make -f src/CMakeFiles/openmp_reduction.dir/build.make src/CMakeFiles/openmp_reduction.dir/depend
make[2]: Entering directory '/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build'
cd /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/src /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/src /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/src/CMakeFiles/openmp_reduction.dir/DependInfo.cmake --color=
Dependee "/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/src/CMakeFiles/openmp_reduction.dir/DependInfo.cmake" is newer than depender "/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/src/CMakeFiles/openmp_reduction.dir/depend.internal".
Dependee "/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/src/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/src/CMakeFiles/openmp_reduction.dir/depend.internal".
Scanning dependencies of target openmp_reduction
make[2]: Leaving directory '/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build'
make -f src/CMakeFiles/openmp_reduction.dir/build.make src/CMakeFiles/openmp_reduction.dir/build
make[2]: Entering directory '/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build'
[ 50%] Building CXX object src/CMakeFiles/openmp_reduction.dir/main.cpp.o
cd /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build/src && /glob/development-tools/versions/oneapi/2023.0.1/oneapi/compiler/2023.0.0/linux/bin/icpx    -fiopenmp -fopenmp-targets=spir64 -fsycl -O3 -DNDEBUG   -o CMakeFiles/openmp_reduction.dir/main.cpp.o -c /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/src/main.cpp
In file included from /home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/src/main.cpp:11:
/glob/development-tools/versions/oneapi/2023.0.1/oneapi/dev-utilities/2021.8.0/include/dpc_common.hpp:14:36: error: use of undeclared identifier 'cl'
static auto exception_handler = [](cl::sycl::exception_list eList) {
                                   ^
1 error generated.
make[2]: *** [src/CMakeFiles/openmp_reduction.dir/build.make:63: src/CMakeFiles/openmp_reduction.dir/main.cpp.o] Error 1
make[2]: Leaving directory '/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build'
make[1]: *** [CMakeFiles/Makefile2:122: src/CMakeFiles/openmp_reduction.dir/all] Error 2
make[1]: Leaving directory '/home/u187665/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build'
make: *** [Makefile:84: all] Error 2

I also tried `nodes=1:xeon:ppn=2` but got the same error.

How can I fix that?

0 件の賞賛
1 解決策
NoorjahanSk_Intel
モデレーター
3,229件の閲覧回数

Hi,

 

Thanks for posting in Intel Communities.

 

We request you to try the sample code on another machine with the below changes as the cl namespace is removed from sycl/sycl.hpp header 

As Intel DevCloud is a shared environment that comes with pre-installed validated Intel oneAPI software and complimentary packages, user's don't have admin privileges in DevCloud to make changes.

 

Replace this line

static auto exception_handler = [](cl::sycl::exception_list eList)

with

static auto exception_handler = [](sycl::exception_list eList)

in dpc_common.hpp , then you will not observe any issues.

Please refer to the below link for more details:

https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpc-c-compiler-release-notes.html

 

We tried this at our end on some other machine(Ubuntu 20.04) with these changes and it worked as expected.

Please refer to the below screenshot for more details:

NoorjahanSk_Intel_0-1678879049291.png

 

Thanks & Regards,

Noorjahan.

 

元の投稿で解決策を見る

4 返答(返信)
NoorjahanSk_Intel
モデレーター
3,230件の閲覧回数

Hi,

 

Thanks for posting in Intel Communities.

 

We request you to try the sample code on another machine with the below changes as the cl namespace is removed from sycl/sycl.hpp header 

As Intel DevCloud is a shared environment that comes with pre-installed validated Intel oneAPI software and complimentary packages, user's don't have admin privileges in DevCloud to make changes.

 

Replace this line

static auto exception_handler = [](cl::sycl::exception_list eList)

with

static auto exception_handler = [](sycl::exception_list eList)

in dpc_common.hpp , then you will not observe any issues.

Please refer to the below link for more details:

https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpc-c-compiler-release-notes.html

 

We tried this at our end on some other machine(Ubuntu 20.04) with these changes and it worked as expected.

Please refer to the below screenshot for more details:

NoorjahanSk_Intel_0-1678879049291.png

 

Thanks & Regards,

Noorjahan.

 

NoorjahanSk_Intel
モデレーター
3,178件の閲覧回数

Hi.


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Noorjahan.


mnt
新規コントリビューター I
3,170件の閲覧回数

Hello,

I wasn't able to setup the example on my own host due to infrastructure limitations. Therefore, I am not able to test that.

However, as you showed a screen shot that the modifications works, I will accept that as an answer. Maybe it helps someone in the future.

Thanks.

NoorjahanSk_Intel
モデレーター
3,159件の閲覧回数

Hi,


Thanks for accepting our solution.

As this issue has been resolved, we will no longer respond to this thread. If you need any additional information, please post a new question


Thanks & Regards,

Noorjahan.


返信