Compile OpenCL on Mingw Nvidia SDK

后端 未结 2 542
小蘑菇
小蘑菇 2020-12-29 09:34

Is it possible to compile OpenCL using Mingw and Nvidia SDK?

I\'m aware that its not officially supported but that just doesn\'t make sense. Aren\'t the libraries pr

2条回答
  •  死守一世寂寞
    2020-12-29 09:51

    OpenCL libraries are just stubs to the OpenCL.dll. I recomend therefore using a dynamic loading technique. It will simply solve all your problems. Or do you really need some of the nVIDIA tweaks of OpenCL?

    It is not only safer at runtime, but also easyer to compile since you need no linker nor defines, nor anything. Just a simple cpp/hpp files added to your proyect.

    A very good one to use is CLEW. However I don't agree completely with that library, because C++ wrappers are broken. So maybe you will need some tweaking. Also I typically disable the "atexit" code, since it can be problematic.

提交回复
热议问题