Maiss
Maiss

Reputation: 1681

OpenCL code to work with both AMD/Nvidia

Could someone tell if it's possible to get an OpenCL code working with both AMD and Nvidia cards after compilation and what is the general procedure for that? Do I need to get both OpenCL SDKs (AMD/Nvidia) installed and with an "if" structure make different code for each cases (AMD device or Nvidia device)? If you could just clarify a bit with some headlines would appreciate it. Thanks.

Upvotes: 3

Views: 1980

Answers (1)

Flavien Volken
Flavien Volken

Reputation: 21349

Yes it is possible, this is the purpose of OpenCL over CUDA (which only works with NVIDIA hardware). Basically you make your code writing kernels in C99 which one will then be compiled in an intermediate "manufacturer independent" code. That last code will then be interpreted by your card (AMD or Nvidia) during the runtime. Normally, there is no reason why you should write different card specific code neither use different SDK (but well… I'm on Max OS 10.7 which possibly differs from other environment)

Upvotes: 4

Related Questions