2
votes

when I use the following line in my OpenCL programs

#pragma OPENCL EXTENSION cl_khr_fp64 : enable 

I get the following OpenCL error:

cl::Error: -46, (std::exception.what() returns "clCreateKernel")

Does anyone know why? What am I doing wrong?

Btw, I have the following system:

[INFO] Name: GeForce GTX 470
[INFO] Vendor: NVIDIA Corporation
[INFO] Profile: FULL_PROFILE
[INFO] Version: OpenCL 1.0 CUDA
[INFO] Driver: 260.19.06

Cheers,

2
What is the build log? You should get it and print it. - Dr. Snoopy

2 Answers

2
votes

I guess the OpenCL 1.0 driver for GeForce GTX 470 you're using doesn't support fp64.

Try the new OpenCL 1.1 driver available here.

2
votes

Are you using C stringification macro by any chance?

If so, you need to change your code to look like this:

#pragma OPENCL EXTENSION cl_khr_fp64 : enable \n

This is because stringification process takes all whitespace and converts it into one space. However, C-preprocessor require "newline" to delimit the next line.