digitalmars.D.learn - CUDA with D?
- Trass3r (1/1) Feb 18 2009 Is there any tutorial or code for using CUDA with D?
- Chris R Miller (14/15) Feb 23 2009 Short answer: no.
- Lutger (2/21) Feb 23 2009 I think OpenCL will be easier and work om AMD to boot.
- Trass3r (2/4) Feb 24 2009 If they ever release it in the next few months ;)
- Trass3r (5/15) Feb 24 2009 What a pity, just read that article and thought it might be possible to
- Chris R Miller (13/28) Mar 01 2009 And I quote:
- Lutger (6/11) Mar 01 2009 It's at a higher level than that, basically shaders for more general pur...
- Chris R Miller (2/12) Mar 03 2009 Hmm, clever.
- Trass3r (3/8) May 05 2009 I think that's not fully correct. You specify yourself which processor
- Trass3r (7/17) Mar 19 2009 Well, that's what I thought about cause real D code on the GPU seems
Trass3r wrote:Is there any tutorial or code for using CUDA with D?Short answer: no. I looked into writing CUDA with D a while back. The problem is that the CUDA C runtime and the D runtime are 100% incompatible. CUDA works by taking C-like code and compiling it with a special NVCC compiler, which emits code that's specifically for NVIDIA GPUs. I found that it would be *possible* to take NVCC and write a D-frontend for it (The MathWorks did it for their MATLAB language), but that was a lot more work that I was willing to do in order to do stupid things like see how fast my graphics card can count to a million. I hope you have better luck! Maybe something has changed... maybe an LLVM->NVCC bridge (so you could take the LDC frontend and plug it into NVCC and there you go? I don't know, it'd be cool, but I *highly* doubt it exists).
Feb 23 2009
Chris R Miller wrote:Trass3r wrote:I think OpenCL will be easier and work om AMD to boot.Is there any tutorial or code for using CUDA with D?Short answer: no. I looked into writing CUDA with D a while back. The problem is that the CUDA C runtime and the D runtime are 100% incompatible. CUDA works by taking C-like code and compiling it with a special NVCC compiler, which emits code that's specifically for NVIDIA GPUs. I found that it would be *possible* to take NVCC and write a D-frontend for it (The MathWorks did it for their MATLAB language), but that was a lot more work that I was willing to do in order to do stupid things like see how fast my graphics card can count to a million. I hope you have better luck! Maybe something has changed... maybe an LLVM->NVCC bridge (so you could take the LDC frontend and plug it into NVCC and there you go? I don't know, it'd be cool, but I *highly* doubt it exists).
Feb 23 2009
Lutger schrieb:I think OpenCL will be easier and work om AMD to boot.If they ever release it in the next few months ;)
Feb 24 2009
Chris R Miller schrieb:Trass3r wrote:What a pity, just read that article and thought it might be possible to get it to work: http://www.ddj.com/architect/211800683 But thanks for your answer. Saves me some time ;)Is there any tutorial or code for using CUDA with D?Short answer: no. I looked into writing CUDA with D a while back. The problem is that the CUDA C runtime and the D runtime are 100% incompatible. CUDA works by taking C-like code and compiling it with a special NVCC compiler, which emits code that's specifically for NVIDIA GPUs.
Feb 24 2009
Trass3r wrote:Chris R Miller schrieb:And I quote: You're still writing in C, just using D to make an (extern) function call. So it's not exactly D on the GPU, so I don't think it counts - plus the build sequence to build the C part with GCC->NVCC pass-through (or the MSVC->NVCC pass-through) would be a absolute nightmare to work with. I looked into OpenCL, which appears (at first glance) to be a funky way of stringing together assembler instructions using C function calls. I'm sure it's fast, but it's not the most friendly looking code to me (then again, I don't know ASM, so what do I know?)Trass3r wrote:What a pity, just read that article and thought it might be possible to get it to work: http://www.ddj.com/architect/211800683 But thanks for your answer. Saves me some time ;)Is there any tutorial or code for using CUDA with D?Short answer: no. I looked into writing CUDA with D a while back. The problem is that the CUDA C runtime and the D runtime are 100% incompatible. CUDA works by taking C-like code and compiling it with a special NVCC compiler, which emits code that's specifically for NVIDIA GPUs.
Mar 01 2009
Chris R Miller wrote: ...I looked into OpenCL, which appears (at first glance) to be a funky way of stringing together assembler instructions using C function calls. I'm sure it's fast, but it's not the most friendly looking code to me (then again, I don't know ASM, so what do I know?)It's at a higher level than that, basically shaders for more general purpose parallel computation BUT: the OpenCL runtime is supposed to take that code and load balance it over whatever processors it can find in your system, GPU's, multiple cores with or without SIMD instructions, whatever.
Mar 01 2009
Lutger wrote:Chris R Miller wrote: ...Hmm, clever.I looked into OpenCL, which appears (at first glance) to be a funky way of stringing together assembler instructions using C function calls. I'm sure it's fast, but it's not the most friendly looking code to me (then again, I don't know ASM, so what do I know?)It's at a higher level than that, basically shaders for more general purpose parallel computation BUT: the OpenCL runtime is supposed to take that code and load balance it over whatever processors it can find in your system, GPU's, multiple cores with or without SIMD instructions, whatever.
Mar 03 2009
Lutger schrieb:It's at a higher level than that, basically shaders for more general purpose parallel computation BUT: the OpenCL runtime is supposed to take that code and load balance it over whatever processors it can find in your system, GPU's, multiple cores with or without SIMD instructions, whatever.I think that's not fully correct. You specify yourself which processor the code should run on.
May 05 2009
Chris R Miller schrieb:You're still writing in C, just using D to make an (extern) function call. So it's not exactly D on the GPU, so I don't think it counts - plus the build sequence to build the C part with GCC->NVCC pass-through (or the MSVC->NVCC pass-through) would be a absolute nightmare to work with.Well, that's what I thought about cause real D code on the GPU seems utopian.I looked into OpenCL, which appears (at first glance) to be a funky way of stringing together assembler instructions using C function calls. I'm sure it's fast, but it's not the most friendly looking code to me (then again, I don't know ASM, so what do I know?)OpenCL is really similar to CUDA, in fact nvidia will support it using CUDA. It also uses an extended subset of C99 which will be somehow compiled. Still wondering how it will work, hopefully it won't have that same problem with the incompatible runtime :(
Mar 19 2009