2

I'm involved in a project where I have to do gpu programming, one of my constraint is to do it on a nvidia device (thus in CUDA). But I haven't access to a device equipped with nvidia gpu.

So I would like to know if there is any wrapper that exist which could allow me to write a CUDA code but executed as an openCL code to make it work on an amd gpu ?

ps : gpuocelot could fit well IF I would not have to do it on windows system.

jehutyy
  • 364
  • 3
  • 11
  • possible duplicate of [GPU Emulator for CUDA programming without the hardware](http://stackoverflow.com/questions/3087361/gpu-emulator-for-cuda-programming-without-the-hardware) – Ivan Aksamentov - Drop Sep 17 '15 at 11:03
  • I know the question is clear, and the answer as well. But if you are starting a new project, isn't it more logical that you do it directly in OpenCL and support all the platforms without emulation? You will probably get better speeds if you use native CL information data about the device characteristics to design your algorithm. – DarkZeros Sep 17 '15 at 19:32
  • Rent one on the AWS cloud http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/using_cluster_computing.html – Tim Child Sep 17 '15 at 20:15
  • "one of my constraint is to do it on a nvidia device (thus in CUDA)" is an incorrect assumption -- NVIDIA devices support OpenCL 1.2! – Dithermaster Sep 17 '15 at 20:23
  • "So I would like to know if there is any wrapper that exist which could allow me to write a CUDA code but executed as an openCL code to make it work on an amd gpu ?" AMD [HIP](https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP) (and the hipify script) may be of interest. – Robert Crovella Mar 26 '16 at 05:26

2 Answers2

3

Is the "CUDA" constraint an actual one? Because GPU programming on NVIDIA hardware doesn't necessarily imply CUDA. You have other possible solutions such as:

If it were me and the code permitting, I would try to develop using Thrust. But that's up to you.

Gilles
  • 9,269
  • 4
  • 34
  • 53
  • Using OpenCL on current NVIDIA products can results in poor performances with respect to the CUDA counterpart implementation. NVIDIA is of course pushing efforts on CUDA performances, while the OpenCL support has been left years behind. – Luca Ferraro Apr 18 '18 at 10:52
2

You could take a look at GPU Ocelot. According to its website:

Ocelot currently allows CUDA programs to be executed on NVIDIA GPUs, AMD GPUs, and x86-CPUs at full speed without recompilation.

fuzzyTew
  • 3,511
  • 29
  • 24
jprice
  • 9,755
  • 1
  • 28
  • 32
  • I looked at gpuocelot but it seems it is availaible for linux only. Is there another option available for windows environment ? – jehutyy Sep 17 '15 at 13:52