cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

hayabusaxps
Journeyman III

help adding double float precision with #pragma OPENCL EXTENSION "CL build error"

i tried addding the

#

 

 

pragma OPENCL EXTENSION cl_khr_fp64 : enable

in the kernal but then i suddenly get an error,

and tested my kernal in the  kernal analyzer but its says

OpenCL Compile Error: clBuildProgram failed (CL_BUILD_PROGRAM_FAILURE).

Line 4: error: unrecognized
          preprocessing directive
  #EXTENSION OPENCL  cl_khr_fp64 : enable  
   ^

1 error detected.

 

 

 

 



0 Likes
11 Replies

What device are you attempting to compile for? Not all devices support cl_khr_fp64.
0 Likes

 

HD 5870

openCL sdk  2.4

catalyst 11.4 beta

 

 

i7 core

device[0] = primary HD 5870

device[1] = secondary HD 5870

 

coding and commandquery  utilizes device[0]

0 Likes

change it into cl_amd_fp64

0 Likes
Melkhior
Journeyman III

Originally posted by: hayabusaxps i tried addding the

[B]

#pragma OPENCL EXTENSION cl_khr_fp64 : enable in the kernal but then i suddenly get an error


The cl_khr_fp64 is not officially supported by AMD on any gpu at the moment, you need to use cl_amd_fp64. The list of supported extensions on each device can be seen with the 'clinfo' binary that is shipped with the SDK. You can also use the various OpenCL query functions to find out at runtime whether a particular extension is supported.

Another solution that works at least on linux is to set the environment variable 'CL_KHR_FP64' to 1. This enable the extension on GPU devices, but is unsupported.

0 Likes

will i still be able to use double floating point on the gpu, if i utilize

cl_amd_fp64

0 Likes

hayabusaxps,

This is a AMD vendor specific extension which AMD supports for its GPUs. This is the only only way currently to work with double on AMD GPUs. In some future release you might expect the khr extension to be supported as well, but i am not aware of its timeline.

0 Likes

will i still be able to use double floating point on the gpu, if i utilize

cl_amd_fp64

0 Likes

Yes, I use cl_amd_fp64 on my Radeon 5870.

0 Likes

Hey Rick, can you help me set it up on my 5870? I don't know where to start but need it for some software. Is it too difficult to walk through? Thanks!

0 Likes

Just add the following line before your kernel...

"

#pragma OPENCL EXTENSION cl_amd_fp64 : enable

"

If you still have problems, please post your code.

The 58xx series supports double precision

0 Likes

You can check the kernels of some double precision(DP) samples in APP SDK to know about how to use the extensions. Run clinfo to know what all extensions are supported by your device.

0 Likes