2
votes

I am working with CUDAfy and C#. For my kernel, I need double precision. In CUDA, this is no problem, it is automatically supported. However, in order to support non NVIDIA hardware, the user should be able to use OpenCL, too. Here, as far as I understand, double precision has to be activated manually. Currently, the compiler throws the exception

Compilation error: :8:32: error: use of type 'double' requires cl_khr_fp64 extension to be enabled

To do so in the kernel code, one would normally add a line

#pragma OPENCL EXTENSION cl_khr_fp64 : enable

Now is there a way to

a) tell CUDAfy to enable double precision on OpenCL hardware or b) load an existing CUDA C code instead of translating the C# code?

My hardware supports CUDA 3.0 and OpenCL 1.2.

1
This is one year old, but have you found any solution to it?John Demetriou

1 Answers

0
votes

In response to part (a)

I have been using CUDAfy with an AMD Radeon 7970 with OpenCL 1.2. With this hardware, CUDAfy automatically enables double precision. I haven't needed to enable it in order to use Doubles in my C# [Cudafy] kernel methods.