Fix use of deprecated OpenCL function

Also specify use of OpenCL 3.0 instead of depending on default.
This commit is contained in:
Stephen Seo 2024-03-07 16:25:46 +09:00
parent 1d27fd3b21
commit d551c9da3b
2 changed files with 5 additions and 1 deletions

View 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)

View 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;