News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ASM + Cuda / OpenCL

Started by johnsa, July 23, 2010, 10:52:24 AM

Previous topic - Next topic

johnsa

Has anyone experimented or tried using Cuda or openCL from an asm project? I'm interested as I'm looking at working on a 64bit asm project, but it would be ideal if I could use something like CUDA too.

Rockoon

Doin't exclude DirectCompute.
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

oex

Nice one I hadnt come across DirectCompute before :bg
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Rockoon

All-in-all tho, OpenCL is probably best because it will even use SSE on your regular CPU cores ..

With 6-core chips now a consumer part ($200 for AMD's) and 8 and 12-core chips on the server scene (right around the corner as consumer grade, maybe 1 year) it would be wise to not shrug off this horsepower .. OpenCL will let you target both CPU and GPU with the same framework ..

of course, there is no common assembly language for GPU's (not even from the same manufacturer) so you are stuck with the C-like syntaxes


When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

oex

Quote from: Rockoon on July 24, 2010, 04:33:39 PM
of course, there is no common assembly language for GPU's (not even from the same manufacturer) so you are stuck with the C-like syntaxes

This wouldnt matter if you could find references to different GPU assembly on the web but I'm having serious difficulty with this.... I have some links to some ASM instruction sets but often links I find are bad quality and incomplete.... It would be nice just to be able to code for my hardware in ASM whatever that may be.... Even a flatpack desk you get given instructions :lol
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

KeepingRealBusy

Quote from: oex on July 24, 2010, 06:50:42 PM
Quote from: Rockoon on July 24, 2010, 04:33:39 PM
of course, there is no common assembly language for GPU's (not even from the same manufacturer) so you are stuck with the C-like syntaxes

This wouldnt matter if you could find references to different GPU assembly on the web but I'm having serious difficulty with this.... I have some links to some ASM instruction sets but often links I find are bad quality and incomplete.... It would be nice just to be able to code for my hardware in ASM whatever that may be.... Even a flatpack desk you get given instructions :lol

And tools, and the glue, etc, etc.

Rockoon

It would be nice, but its not going to happen.

The GPU makers do not want to fragment the market (a game that works on 7xxx series but not 8xxx...), or lock themselves into an instruction set to be compatible with (8xxx series being 7xxx binary compatible, with some more instructions)

You will get that power eventually.. but it will be on the CPU.
When C++ compilers can be coerced to emit rcl and rcr, I *might* consider using one.

johnsa

I'm fine with c syntax if I must to create the necessary modules etc.

I was curious about which API to use. I saw on the Nvidia doc there is a low level API which looks like it should just be a case of porting the C headers to use with masm.. ? It doesn't integrate with the rest of your code as nicely as the whole VS / c++ / nsight environment would.. but it would still be great.

The project I have in mind is my proprietary Database that I use for some projects. At the moment it's all CPU/main mem bound, and I was thinking about what parts of it I could ship to the GPU, like bitmap index lookups or any special query functions.

Neo

If complexity is what you're concerned with, OpenCL's generally speaking MUCH more complicated to use than CUDA and non-negligibly slower than CUDA, but that said, I'm not sure on how to access CUDA from assembly, since the C stuff has its own syntax.

Some related papers:
A Performance Comparison of CUDA and OpenCL
High-Performance Physics Simulations Using Multi-Core CPUs and GPGPUs in a Volunteer Computing Context (shows some of the extra CUDA syntax)