Closed ddemidov closed 3 years ago
CC @blattms
:+1:
Ok, I have tested this and it works for. From inspecting the code it should also work on not so recent distributions.
I also tested it with the examples of amgcl (Now I know why compiling it is off by default. :wink: Takes up to 600 MB per process and very long. Needed to reduce the parallel build processes to 4 as my system only has 2.6 GB in the /tmp directory). You might want to specify CL_TARGET_OPENCL_VERSION similar to the HPP ones as currently we might mix OpenCL Standards:
[ 75%] Building CXX object tutorial/2.Serena/CMakeFiles/serena_vexcl_jit.dir/serena_vexcl.cpp.o
cd /home/mblatt/src/3rdparty/amgcl/build/tutorial/2.Serena && /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_T
HREAD_DYN_LINK -DVEXCL_BACKEND_JIT -DVEXCL_JIT_COMPILER_FLAGS="" -DVEXCL_OMP_FLAGS=-fopenmp -I/home/mblatt/src/3rdparty/amgcl -isystem /home/mblatt/opt/vexcl/include -O2 -g -DNDEB
UG -fopenmp -Wno-missing-braces -Wno-deprecated-declarations -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-variadic-macros -Wno-catch-value -Wall -Wextra -Wpedantic -o C
MakeFiles/serena_vexcl_jit.dir/serena_vexcl.cpp.o -c /home/mblatt/src/3rdparty/amgcl/tutorial/2.Serena/serena_vexcl.cpp
In file included from /usr/include/CL/cl_platform.h:20,
from /home/mblatt/opt/vexcl/include/vexcl/types.hpp:47,
from /home/mblatt/opt/vexcl/include/vexcl/backend/jit/source.hpp:42,
from /home/mblatt/opt/vexcl/include/vexcl/backend/jit.hpp:41,
from /home/mblatt/opt/vexcl/include/vexcl/backend.hpp:74,
from /home/mblatt/opt/vexcl/include/vexcl/vector.hpp:49,
from /home/mblatt/src/3rdparty/amgcl/amgcl/backend/vexcl.hpp:40,
from /home/mblatt/src/3rdparty/amgcl/tutorial/2.Serena/serena_vexcl.cpp:4:
/usr/include/CL/cl_version.h:22:104: note: '#pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)'
22 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)")
| ^
[ 76%] Linking CXX executable poisson3Db_mpi_vexcl_comp
You might want to specify CL_TARGET_OPENCL_VERSION similar to the HPP ones as currently we might mix OpenCL Standards:
Done, and merged. Thanks!
I have thank you. Thanks a lot for the fix.
If you are focusing on C++17 or higher you could perhaps simplify the approach by just using __has_include()
https://en.cppreference.com/w/cpp/preprocessor/include
Thank you Ronan! Unfortunately, vexcl code is currently fixed at the c++11 standard. Although even just the return type deduction from c++14 would make the code much cleaner.
Isn't it a good opportunity to move forward by 6 years? ;-)
CL/cl.hpp
is no longer available from Khronos. The recommended header to include isCL/opencl.hpp
, but some systems may only provide the deprecatedCL/cl2.hpp
. See discussion in #286.