3 ms·
no, my frame of reference is all the talks, workshops, and presentations i've attended, papers i've read, and real code i've seen and worked with. setting a si
by foxhill 13y ago
no, my frame of reference is all the talks, workshops, and presentations i've attended, papers i've read, and real code i've seen and worked with.
setting a single scalar argument requires no extra dereferencing in the kernel. if you're setting an array of values, then you'd need to dereference (via array indexing), but you'd need to do that in CUDA too. besides, even if you did have to dereference it, writing it into a private variable would save future dereferences, and even a basic optimising compiler would do this by default.
and you talk about persistent global state as if you'd want that. global variables (in any language) are generally considered bad practise.
OpenCL 2.0 has dynamic parallelism, too.
.. are you being serious? maybe monopoly means something different to me? exactly, how many brands of GPU have official support for CUDA? yes, CUDA came before OpenCL, and nvidia are (still) a part of "the committee" - khronos. but it was apple that created OpenCL, handing it to khronos after they came up with 1.0.
that said, it was neither apple or nvidia, that came up with the idea of compute on the GPU. BrookGPU is the real project that kick started GPGPU.
i hate to nit-pick, but the Titan is kepler, not fermi. architecture output of nvcc? i don't even know what you mean. for the codes in which i've written both OpenCL and CUDA, the performance difference is almost measurement noise.
my complaint of using CUDA in rust is as follows - rust is an open language, being created by an "open source" company. it makes absolutely no sense to me, that a company with free software principles should make their language dependent on a specific vendor. i don't think that's an outlandish complaint. imagine if rust only compiled for intel CPUs. or only worked in windows.
- goldenkey 13y agoOpenCL: __kernel myKernel(int* theMem){ *theMem = 0xDEAD; } CUDA: __device theMem; __kernel myKernel(void){ theMem = 0xBEEF; } nvcc has a lot of nice flags to set max register count as well as smi architecture or compute_architecture. It's a little bit more flexible than OpenCL. http://camolab.googlecode.com/svn/trunk/mycode/cuda/nvcc-help.txt http://camolab.googlecode.com/svn/trunk/mycode/cuda/nvcc-hel... Anyhow, Mozilla's decisions are Mozilla's alone, you shouldn't bad angry at anyone _but_ Mozilla for taking the bait.
- foxhill 13y agoyou are mistaken. //kernel __kernel myKernel (int val){ //... } //host int val = 10; clSetKernelArg(kernel, 0, val, sizeof(int)); similarly, for architecture/max reg count, clBuildProgram(..., "-cl-nv-arch sm_35 -cl-nv-maxrregcount 20",...); i'm not angry at anyone. i disagree with mozilla's decision. that is all.
- goldenkey 13y agoSetting a kernel argument in this manner can only be used for inputs to the kernel. Any output you want to read (either in a subsequent kernel or from the host program) must be written to a buffer or an image. In your case, that means you need to create a single-element buffer and pass the buffer to the kernel.
- foxhill 13y agowell, either way, in the snippet of code you just posted, your assignment is still a dereference. CUDAs &theMem is a pointer to somewhere in memory, OpenCL's theMem is a pointer to somewhere in memory. in the back end of CUDA, it's doing the same thing as what you would explicitly do in OpenCL. we could talk about minor language difference for days. really, there is no major difference between OpenCL and CUDA (and that's one of the main reasons i'll write CUDA code - when i know my code will only ever run on nvidia GPUs). but when i write OpenCL code, i know it will run on all GPUs, and CPUs, and any accelerator that has an OpenCL stack.
- goldenkey 13y agoIt's actually not the same thing. I've looked at the PTX disassembly and the difference is that the OpenCL code must perform a dereference while the CUDA code can use a fixed address, (relocatable of course.) The address is relocated based on the loaded base address of the kernel module. So there is a huge gain for certain types of code to save an instruction and possible warping, cache miss, register pressure, etc. Right, OpenCL runs on the Knights Corner/Bridge (PHI - what a piece of crap btw), CPUs, and many other devices, it has its place. And CUDA does too. I write CUDA when I'm on Nvidia devices because of the dereferencing performance as well as the slight speed gain that the double-buffering of workgroups that CUDA supports slightly better than OpenCL. All in all, they're pretty on par, I'm fond of CUDA a little more due to the clarity of its driver API and non-evented model. It's a little bit easier to work with. Anyhow, I think we're done here. I got you to admit that CUDA isn't a piece of monopolistic smudgenry. Which is really all I wanted :-)
- kibwen 13y ago> it makes absolutely no sense to me, that a company with > free software principles should make their language > dependent on a specific vendor None of this work has been done by any Mozilla employee. One of the side-effects of being open-source is that anyone is free to take your code and make whatever extensions they want to it.
- foxhill 13y agosorry, you are correct. i've taken much less time in reading the article, than i have in expressing my arguments in these comments -_-