c++graphics3dgpgpu

Perform vector calculation on GPU in C++, regardless of brand


How do I perform a calculation (and assign the result to a variable), regardless of brand (AMD, Nvidia, even an iGPU) on a GPU?

I would like the most simple and efficient API, something where I can just call a function with the input of the calculation and it will calculate it on the GPU, and assign the value to the float t.

The calculation is:

float t = - (dot(N, orig) + D) / dot(N, dir);

...from here.


Solution

  • Ok. Took me a bit of Google searching, but eventually I decided on SYCL (oneapi). The installation process was tough, but once I got it working, it was perfect for my application.