the swine
the swine

Reputation: 11031

OpenCL 2.0 on AMD GPU

I'm trying to initialize OpenCL 2.0 on AMD Fury X and I'm looking at the value of __OPENCL_VERSION__. It is 120 no matter what. I'm looking inside my driver and both #define __OPENCL_VERSION__ 120 and #define __OPENCL_VERSION__ 200 can be found there.

Does there need to be a special flag somewhere to enable version 2.0? I have the following platform and device:

OpenCL platform 'AMD Accelerated Parallel Processing' by Advanced Micro Devices, Inc., version OpenCL 2.0 AMD-APP (1912.5), FULL_PROFILE
device: Advanced Micro Devices, Inc. 'Fiji' (driver version: 1912.5 (VM))
OpenCL version: OpenCL 2.0 AMD-APP (1912.5)
OpenCL "C" version: OpenCL C 2.0

EDIT

Ah, silly. It seems to help to specify -cl-std=CL2.0 in the compiler options in clCreateProgramWithSource. Is that supposed to be the expected behavior?

Upvotes: 1

Views: 1367

Answers (1)

jprice
jprice

Reputation: 9925

Is that supposed to be the expected behaviour?

Yes. Here's the relevant paragraph from the OpenCL 2.0 specification (section 5.8.4.5 Options Controlling the OpenCL C version):

If the –cl-std build option is not specified, the highest OpenCL C 1.x language version supported by each device is used when compiling the program for each device. Applications are required to specify the –cl-std=CL2.0 option if they want to compile or build their programs with OpenCL C 2.0.

Upvotes: 5

Related Questions