Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need a quick brush up on how I can conditionally (pre-process) code and check to see what GPU is installed or the such. Why I need this is because I am writing a program that is expected to be very cross-platform and capable of having workarounds on mostly all modern hardware. For GPGPU specifically, I can use CUDA if NVidia is detected; however, it can't be used on non-NVidia GPUs, so I'd need to conditionally check this (and add OpenCL or some other library to aid in GPGPU).

I will learn with other OSes, but for now, how can I do this on Windows? I've searched NVidia's website and they say nothing about determining CUDA in pre-compilation (without having it installed, which it needs not be). Here's a pseudo-way of looking at it:

IF (ANY) NVIDIA GPU AND OR OPENGL 4 - > INCLUDE CUDA LIBRARY AND IMPLEMENT IT.

IF (ANY) NVIDIA GPU NOT DETECTED - > INCLUDE OPENCL AND IMPLEMENT IT.

IF AMD ATI RADEON 7x/8x VERSION - > INCLUDE MANTLE API AND OPENCL.

I need to set up conditional compiling schemes so that others can safely test and execute the program as it grows on different platforms, GPUs, etc.
Posted
Comments
BillWoodruff 17-Sep-14 1:34am    
Should you post this question in the C++ QA section ?

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900