Many OpenCL SDK's. Which of them i should choose?

青春壹個敷衍的年華 提交于 2020-01-05 02:31:33

问题


In my computer with Windows 7 OS I have three versions of OpenCL SDKS's from this vendors:

  • Intel
  • NVIDIA
  • AMD.

I build my application with each of them. As the output I have three different binaries. For example: my_app_intel_x86, my_app_amd_x86, my_app_nvidia_x86

This binaries are different on this:

  1. They use different SDK's in likange process
  2. They try to find different OpenCL platform name in runtime

Can I use only one SDK and check platform on running time?


回答1:


SDK's give debuggings tools, a platform, and possibly extensions, the OpenCL API remains the same regardless. You can link to any SDK you want, and it'll produce an executable compatible with any OpenCL runtimes you can find. Remember those are SDK's, meant for the developer - the end-user will probably only have his graphics driver (OpenCL-enabled) which doesn't care what SDK you used to build the software.

Ideally you should use a default platform for your program, but let the user override it (you can select various platforms at runtime!). You can also use heuristics to figure out which device is the fastest, e.g.:

  • iterate over each available platform
  • for each platform, iterate over each device
  • benchmark this device somehow in a relevant way
  • select the fastest one

Also, if you are using specific extensions, make sure to only accept devices which support them...

Can I use only one SDK and check platform on running time?

Yes, you absolutely can and should do that, but I am worried about what you mean by "check platform" - as I stated above, the SDK bears absolutely no influence on the platforms you can run your built program on. I can build my code with the AMD SDK, and run the executable on a system with an nVidia graphics card or an Intel processor just fine (the only difference is that I may not have access to AMD-specific extensions which will be provided by my SDK, but the extensions will be recognized by an AMD driver, so you don't even need the SDK installed to run the code - but you will to build it though).



来源:https://stackoverflow.com/questions/13526984/many-opencl-sdks-which-of-them-i-should-choose

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!