4 ms·
Nope. I have some substantial simulation code written against OpenCL that runs on Intel OpenCL and NVIDIA without modifications, and rather performant on both o
by marmaduke 10y ago
Nope. I have some substantial simulation code written against OpenCL that runs on Intel OpenCL and NVIDIA without modifications, and rather performant on both of them. The only part of the code specific to vendor is the platform selection, which is one line of code.
OpenCL falls down in terms of standard libraries such as cu{dnn,sparse,blas} but if you're writing everything from scratch it's fine.
- dagss 10y agoInteresting...so do you use the vector subset designed for CPUs or the wavefront subset designed for GPUs?
- marmaduke 10y agoI write code which maximizes coalesced memory access and plain old 32 bit floats.. nothing special. The respective drivers do a good job of mapping that onto the hardware given sufficient work group sizes.
- joe_the_user 10y agoI'm an independent developer in the process of choosing a GPGPU library. I can see simple, comprehensible 20-50 sample code for cuda that does most simple tasks. With OpenCL, I get references to version, boiler-plate, mode with nothing that boils down to simple code. If you have a simple sample, you should post it here or blog about it.
- duaneb 10y agoBoilerplate is one thing—this is what transpilers are for, among other solutions—but can OpenCL match CUDA on a performance level?
- marmaduke 10y agoCl is comparable to Cuda where the cuda code doesn't employ nvidia specific primitives.
- marmaduke 10y agoLook at Pyopencl; it makes it quite easy to prototype OpenCL apps in tens of lines of code. Later, it's straightforward to port to c or c++ if that's your thing, though I find having numpy et al handy even in production code