cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

bayoumi
Journeyman III

clc does not recognize "double"

I wanted to draw your attention that for OpenCl SDK 2.2/2.3, the clc offline bin utility does not recognize the keyword double, or the double #prgama extension. I had to use the clc from the 2.1 SDK, which in turn does not recognize the "printf" extension.

This is for the linux 64b kit

0 Likes
7 Replies

bayoumi,
You have to define the extension. -Dcl_khr_fp64=1 or -Dcl_amd_printf=1

Micah
0 Likes
bayoumi
Journeyman III

Micah,

I already put in my .cl file:

#pragma OPENCL EXTENSION cl_amd_fp64 : enable
#pragma OPENCL EXTENSION cl_amd_printf : enable

isn't this enough

0 Likes

That is enough for the kernel, but the frontend has no notion of what extensions are supported on what devices, for that you need to define the extension. Really you should be using the OpenCL interface to do what you want to do.

Micah
0 Likes

So how can I check syntax error offline? Besides, the API usually ends  up with a load-time error number "cannot build program"

0 Likes

Create a small wrapper program that loads the platform, loads the kernel, compiles it for your device and prints out the log.
0 Likes

thank Micah

I hate to be persistant, but what is the problem of clc bin as was the case with pre-sdk 2.2?

Isn't it logical to see the syntax errors using makefiles with the rest of the C files syntax checks?

0 Likes

CLC as a binary was never the correct path to compile CL programs. In order to correctly compile CL kernels, the compiler must know information about what device it is being compiled for and what options are available for that device. Using the API calls is the correct way to do this as all of the information is there. You can write your own compiler driver that does exactly what clc does very easily and use that to do syntax checking in the make files for now.
0 Likes