From: Stephen Seo Date: Thu, 7 Mar 2024 07:25:46 +0000 (+0900) Subject: Fix use of deprecated OpenCL function X-Git-Url: https://git.seodisparate.com/stephenseo/static/search/searchdata.js?a=commitdiff_plain;h=d551c9da3b287b1e55a8b4b4c9f660c37d686f1e;p=EN605.617.81.FA21_StephenSeo_DitheringProject Fix use of deprecated OpenCL function Also specify use of OpenCL 3.0 instead of depending on default. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6939390..32eaa03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,3 +40,6 @@ target_link_libraries(DitheringProject PUBLIC ${PNG_LIBRARIES} ${FFMPEG_LIBAVCODEC_LINK_LIBRARIES} ) + +target_compile_definitions(DitheringProject PRIVATE + CL_TARGET_OPENCL_VERSION=300) diff --git a/src/opencl_handle.cc b/src/opencl_handle.cc index 60ee73e..d4baaca 100644 --- a/src/opencl_handle.cc +++ b/src/opencl_handle.cc @@ -780,7 +780,8 @@ OpenCLContext::OpenCLContext() : context_(nullptr), queue_(nullptr) { } // uses first available device - queue_ = clCreateCommandQueue(context_, devices.at(0), 0, &err_num); + queue_ = clCreateCommandQueueWithProperties(context_, devices.at(0), nullptr, + &err_num); if (err_num != CL_SUCCESS) { std::cout << "ERROR: OpenCLContext: Failed to create command queue" << std::endl;