]> git.seodisparate.com - EN605.617.81.FA21_StephenSeo_DitheringProject/commitdiff
Fix use of deprecated OpenCL function
authorStephen Seo <seo.disparate@gmail.com>
Thu, 7 Mar 2024 07:25:46 +0000 (16:25 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 7 Mar 2024 07:25:46 +0000 (16:25 +0900)
Also specify use of OpenCL 3.0 instead of depending on default.

CMakeLists.txt
src/opencl_handle.cc

index 6939390c6686489964b44ae272a15c328c26645a..32eaa03ef941b91911f7b940896ad26b6adcf66e 100644 (file)
@@ -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)
index 60ee73e7ea8b21e764f5e37bb065533c352e62a0..d4baaca6154dd75939939c0f03519e48488994fe 100644 (file)
@@ -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;