3 ms·
at the kernel level, fortran isn't really that different to C. it has a power operator. there is no for loop. you certainly will not be reading from files insid
by foxhill 12y ago
at the kernel level, fortran isn't really that different to C. it has a power operator. there is no for loop. you certainly will not be reading from files inside a kernel, so.. why do you want to use fortran? i can't tell you whom, but one of the big OpenCL vendors is actually working on fortran OpenCL kernels, as a direct result of SPIR.
if you want C++ in your kernels.. well, you're going to have a bad time if you want performance.
- MaxBarraclough 12y ago> why do you want to use fortran? Performance, and legacy code? > if you want C++ in your kernels.. well, you're going to have a bad time if you want performance. Not necessarily, no. Only if you abuse it.
- foxhill 12y ago> Performance largely myth > legacy code using OpenCL is not like OpenMP, you don't just add a few pragmas and you're set. C code needs to be rewritten for OpenCL. this is largely copy and paste, due to the syntax being so similar, assuming you have mathsy things in your kernels, but the same is true for fortran. replace array access brackets with square brackets, replace power operators with the built-in power functions, etc. porting legacy (usually fortran) codes to OpenCL/CUDA is actually what i do for a living.