Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RUNTIME][OPENCL] Make OpenCL runtime Compatible with OpenCL2.0 #2897

Closed
ghost opened this issue Mar 26, 2019 · 6 comments
Closed

[RUNTIME][OPENCL] Make OpenCL runtime Compatible with OpenCL2.0 #2897

ghost opened this issue Mar 26, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 26, 2019

Build opencl fails with:

tvm/src/runtime/opencl/opencl_device_api.cc:278:9: error: ‘_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Werror=deprecated-declarations]

The clCreateCommandQueue API is deprecated in OpenCL2.0.

Possible solutions:

  1. Switch to clCreateCommandQueueWithProperties

  2. Define either we need to:
    #define CL_USE_DEPRECATED_OPENCL_1_2_APIS prior to the inclusion of cl.h

@tqchen tqchen changed the title clCreateCommandQueue deprecated build error [RUNTIME][OPENCL] Make OpenCL runtime Compatible with OpenCL2.0 Mar 26, 2019
@tqchen
Copy link
Member

tqchen commented Mar 26, 2019

cc @kazum , likely we can detect the OpenCL version in macro and use the new API(it is not yet available in old version of the API).

@kazum
Copy link
Contributor

kazum commented Mar 27, 2019

I think we cannot detect the OpenCL version statically - we need to query it with the OpenCL APIs. Maybe, it's possible to detect the version in cmake and define an appropriate macro.

Anyway, there are still many OpenCL platforms which don't support OpenCL 2.0. Defining CL_USE_DEPRECATED_OPENCL_1_2_APIS looks good for now.

@tqchen
Copy link
Member

tqchen commented Mar 27, 2019

By search around i have found __OPENCL_VERSION__ , not sure if it is part of standnard

@kazum
Copy link
Contributor

kazum commented Mar 27, 2019

Is __OPENCL_VERSION__ only available in OpenCL kernel code? https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/preprocessorDirectives.html

I searched the macro in the official OpenCL headers (https://github.com/KhronosGroup/OpenCL-Headers), but couldn't find it. Even if it is defined there, the supported OpenCL version is up to the target device, IIUC.

@tqchen
Copy link
Member

tqchen commented Apr 1, 2019

OK, perhaps we can define the backward compatible flag for now then

yzhliu pushed a commit that referenced this issue Apr 3, 2019
…#2950)

There are many OpenCL platforms that do not yet support OpenCL 2.0,
hence we use 1.2 APIs, some of which are now deprecated.  In order
to turn off the deprecation warnings (elevated to errors by
-Werror) we explicitly disable the 1.2 deprecation warnings.

At the point TVM supports minimum version 2.0, this commit can be
reverted.
@ghost
Copy link
Author

ghost commented Apr 3, 2019

Resolved by #2950

@ghost ghost closed this as completed Apr 3, 2019
wweic pushed a commit to wweic/tvm that referenced this issue Apr 7, 2019
…e#2897 (apache#2950)

There are many OpenCL platforms that do not yet support OpenCL 2.0,
hence we use 1.2 APIs, some of which are now deprecated.  In order
to turn off the deprecation warnings (elevated to errors by
-Werror) we explicitly disable the 1.2 deprecation warnings.

At the point TVM supports minimum version 2.0, this commit can be
reverted.
wweic pushed a commit to wweic/tvm that referenced this issue Apr 7, 2019
…e#2897 (apache#2950)

There are many OpenCL platforms that do not yet support OpenCL 2.0,
hence we use 1.2 APIs, some of which are now deprecated.  In order
to turn off the deprecation warnings (elevated to errors by
-Werror) we explicitly disable the 1.2 deprecation warnings.

At the point TVM supports minimum version 2.0, this commit can be
reverted.
wweic pushed a commit to wweic/tvm that referenced this issue Apr 8, 2019
…e#2897 (apache#2950)

There are many OpenCL platforms that do not yet support OpenCL 2.0,
hence we use 1.2 APIs, some of which are now deprecated.  In order
to turn off the deprecation warnings (elevated to errors by
-Werror) we explicitly disable the 1.2 deprecation warnings.

At the point TVM supports minimum version 2.0, this commit can be
reverted.
wweic pushed a commit to wweic/tvm that referenced this issue Apr 10, 2019
…e#2897 (apache#2950)

There are many OpenCL platforms that do not yet support OpenCL 2.0,
hence we use 1.2 APIs, some of which are now deprecated.  In order
to turn off the deprecation warnings (elevated to errors by
-Werror) we explicitly disable the 1.2 deprecation warnings.

At the point TVM supports minimum version 2.0, this commit can be
reverted.
wweic pushed a commit to neo-ai/tvm that referenced this issue Apr 11, 2019
…e#2897 (apache#2950)

There are many OpenCL platforms that do not yet support OpenCL 2.0,
hence we use 1.2 APIs, some of which are now deprecated.  In order
to turn off the deprecation warnings (elevated to errors by
-Werror) we explicitly disable the 1.2 deprecation warnings.

At the point TVM supports minimum version 2.0, this commit can be
reverted.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants