1

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?

the swine
  • 10,713
  • 7
  • 58
  • 100

1 Answers1

5

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.

jprice
  • 9,755
  • 1
  • 28
  • 32
  • Should have googled harder. I have another problem, when compiled this way and saving the binary, the `clCreateProgramWithBinary()` crashes the application (some access violation inside the call). Do you happen to have any experience with that? Works well without `-cl-std=CL2.0`. – the swine Dec 16 '15 at 17:30
  • No personal experience, but any crash like that sounds like a bug to me. Best raise a bug with AMD directly for that. – jprice Dec 16 '15 at 17:35