Skip to content

Remove deprecated function clCreateCommandQueue #5

@dineiar

Description

@dineiar

The step "Build library" of the GitHub build action that is triggered on every commit outputts the following message (ex.: https://github.com/GMAP/GSParLib/actions/runs/8041704362/job/21961317445):

Compiling and assembling object build/GSPar_OpenCL.o...
g++  -Wall -std=c++14 -O3 -Wno-reorder -I/usr/local/cuda/include -Isrc -c -fPIC -o build/GSPar_OpenCL.o src/GSPar_OpenCL.cpp
src/GSPar_OpenCL.cpp: In member function ‘virtual _cl_command_queue* GSPar::Driver::OpenCL::ExecutionFlow::start()’:
src/GSPar_OpenCL.cpp:165:48: warning: ‘_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations]
  165 |         this->flowObject = clCreateCommandQueue(device->getContext(), device->getBaseDeviceObject(), 0, &status);
      |                            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/CL/opencl.h:24,
                 from src/GSPar_OpenCL.hpp:8,
                 from src/GSPar_OpenCL.cpp:11:
/usr/include/CL/cl.h:1[9](https://github.com/GMAP/GSParLib/actions/runs/8041704362/job/21961317445#step:7:10)06:1: note: declared here
 [19](https://github.com/GMAP/GSParLib/actions/runs/8041704362/job/21961317445#step:7:20)06 | clCreateCommandQueue(cl_context                     context,
      | ^~~~~~~~~~~~~~~~~~~~

We should remove the deprecated function clCreateCommandQueue. According to jprice on StackOverflow:

The clCreateCommandQueue function was deprecated as of OpenCL 2.0, and replaced with clCreateCommandQueueWithProperties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions