C: Usage of any GPU for parallel calculations

137 views Asked by At

I recently wrote some software that makes a lot of calculations.

The calculations are done in levels, while for each level, the calculations within it are independent. I.e. logically, I can run them in parallel, as none of them relies on the result of the others.

My question is: Is there a general C library for making parallel math (matrix) operations on the GPU, which works on all the platforms (Windows/Unix/etc.)?

When I say general - I mean to some library that would work with any modern GPU

2

There are 2 answers

0
Mike Armstrong On

... off loading bitcoin miners? ;)

& well, if you can compile your source directly on the host machine, then you can specify to the compiler,

# IF (some operating system) THEN

& that will solve that. Going back to your parallel computing problem, CUDA.h functions will calculate your this and that on the GPU, but that will most likely require some serious jigging if you say that you have already wrote the calculations part of your project.

1
Mike Armstrong On

C is a singlethreaded language, to assign your calculations to run in parallel on a GPU, for something like 'oh I don't know' Bitcoin mining, you should consider using the AMP library in C++. I'm not too sure about the whole, compile to run on GPU core thing, but I know that this will certainly perform your calculations in parallel.