Skip to content

[Build] cannot convert ‘cl::Platform’ to ‘cl_platform_id’ #3558

Description

@xokdvium
opencl/device_manager.cpp:265:52: error: cannot convert ‘cl::detail::param_traits<cl::detail::cl_device_info, 4145>::param_type’ {aka ‘cl::Platform’} to ‘cl_platform_id’ {aka ‘_cl_platform_id*’} in initialization

Description

This error is due to breaking change to opencl-clhpp https://github.com/KhronosGroup/OpenCL-CLHPP/releases/tag/v2023.12.14 getInfo<CL_DEVICE_PLATFORM> now returns a different type.

According to the release notes the correct way to do this now is (calling operator() on the returned object):

devices[i]->getInfo<CL_DEVICE_PLATFORM>()();

Error Log

[ 29%] Linking CXX executable basic_unified
[ 29%] Built target test_basic_unified
[ 29%] Building CXX object src/backend/opencl/CMakeFiles/afopencl.dir/errorcodes.cpp.o
[ 29%] Building CXX object test/CMakeFiles/test_clamp_cpu.dir/clamp.cpp.o
[ 29%] Linking CXX executable canny_unified
[ 29%] Built target test_canny_unified
[ 29%] Building CXX object src/backend/opencl/CMakeFiles/afopencl.dir/Event.cpp.o
[ 29%] Linking CXX executable bilateral_unified
[ 29%] Built target test_bilateral_unified
[ 30%] Building CXX object src/backend/opencl/CMakeFiles/afopencl.dir/exampleFunction.cpp.o
[ 30%] Linking CXX executable cholesky_dense_unified
[ 30%] Built target test_cholesky_dense_unified
[ 30%] Building CXX object src/backend/opencl/CMakeFiles/afopencl.dir/fast.cpp.o
/home/xokdvium/Work/Programming/arrayfire/src/backend/opencl/device_manager.cpp: In constructor ‘arrayfire::opencl::DeviceManager::DeviceManager()’:
/home/xokdvium/Work/Programming/arrayfire/src/backend/opencl/device_manager.cpp:265:52: error: cannot convert ‘cl::detail::param_traits<cl::detail::cl_device_info, 4145>::param_type’ {aka ‘cl::Platform’} to ‘cl_platform_id’ {aka ‘_cl_platform_id*’} in initialization
  265 |             devices[i]->getInfo<CL_DEVICE_PLATFORM>();
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                    |
      |                                                    cl::detail::param_traits<cl::detail::cl_device_info, 4145>::param_type {aka cl::Platform}
[ 30%] Building CXX object test/CMakeFiles/test_clamp_unified.dir/clamp.cpp.o
[ 30%] Linking CXX executable clamp_cpu

Build Environment

Compiler version: gcc 13.2.0
Operating system: NixOS 24.05
Build environment: nixpkgs derivation for arrayfire
CMake variables:

AF_BUILD_CPU:BOOL=ON
AF_BUILD_CUDA:BOOL=OFF
AF_BUILD_DOCS:BOOL=OFF
AF_BUILD_EXAMPLES:BOOL=ON
AF_BUILD_FORGE:BOOL=OFF
AF_BUILD_ONEAPI:BOOL=OFF
AF_BUILD_OPENCL:BOOL=ON
AF_BUILD_UNIFIED:BOOL=ON
AF_COMPUTE_LIBRARY:STRING=FFTW/LAPACK/BLAS
AF_CTEST_SEPARATED:BOOL=OFF
AF_STACKTRACE_TYPE:STRING=Basic
AF_WITH_CUDNN:BOOL=OFF
AF_WITH_EXTERNAL_PACKAGES_ONLY:BOOL=OFF
AF_WITH_FAST_MATH:BOOL=OFF
AF_WITH_FMT_HEADER_ONLY:BOOL=OFF
AF_WITH_SPDLOG_HEADER_ONLY:BOOL=OFF
AF_WITH_STATIC_CUDA_NUMERIC_LIBS:BOOL=OFF
BUILD_TESTING:BOOL=ON
CLBlast_DIR:PATH=/nix/store/sh0r8ik7j7dakq3iqsq99nk8f3xk1cq5-clblast-1.6.2/lib/cmake/CLBlast
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/var/empty/local
GTest_DIR:PATH=/nix/store/s7kynjhc8080x9v2qgngs9bfqk59zkmc-gtest-1.14.0-dev/lib/cmake/GTest
MKL_Core_LINK_LIBRARY:FILEPATH=MKL_Core_LINK_LIBRARY-NOTFOUND
MKL_DIR:PATH=MKL_DIR-NOTFOUND
MKL_FFTW_INCLUDE_DIR:PATH=MKL_FFTW_INCLUDE_DIR-NOTFOUND
MKL_INCLUDE_DIR:PATH=MKL_INCLUDE_DIR-NOTFOUND
MKL_Interface_LINK_LIBRARY:FILEPATH=MKL_Interface_LINK_LIBRARY-NOTFOUND
MKL_RT_LINK_LIBRARY:FILEPATH=MKL_RT_LINK_LIBRARY-NOTFOUND
MKL_THREAD_LAYER:STRING=Intel OpenMP
MKL_ThreadLayer_LINK_LIBRARY:FILEPATH=MKL_ThreadLayer_LINK_LIBRARY-NOTFOUND
MKL_ThreadingLibrary_LINK_LIBRARY:FILEPATH=MKL_ThreadingLibrary_LINK_LIBRARY-NOTFOUND
MKL_mkl_avx2_LINK_LIBRARY:FILEPATH=MKL_mkl_avx2_LINK_LIBRARY-NOTFOUND
MKL_mkl_avx512_LINK_LIBRARY:FILEPATH=MKL_mkl_avx512_LINK_LIBRARY-NOTFOUND
MKL_mkl_avx_LINK_LIBRARY:FILEPATH=MKL_mkl_avx_LINK_LIBRARY-NOTFOUND
MKL_mkl_def_LINK_LIBRARY:FILEPATH=MKL_mkl_def_LINK_LIBRARY-NOTFOUND
MKL_mkl_mc3_LINK_LIBRARY:FILEPATH=MKL_mkl_mc3_LINK_LIBRARY-NOTFOUND
MKL_mkl_mc_LINK_LIBRARY:FILEPATH=MKL_mkl_mc_LINK_LIBRARY-NOTFOUND
cl2hpp_header_file_path:PATH=/nix/store/v2vfsl6gqg9k0blk8rfmj8100bcfdq13-opencl-clhpp-2024.05.08/include

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions