Cuda for Pascal(Delphi) ?

Cuda for Pascal(Delphi) ???

does delphi still exist?

anyway, I think you can call C from pascal so you can call cuda too

delphi not support :


global function aaa(aaa:Pointer)


The easiest way to use CUDA from other languages is to compile your CUDA code in a separate module with a plain C interface. Pretty much every language then has a way to call C functions.



Welcome to the 21st century where linux support matters.

I made my first steps in using the cuda API and FFT in Delphi. Attached my basic work, containing import units for cudart.dll (only ver few functions) and cufft.dll. It would be nice to hear some comments.

Update, I have implemented the cudaMemcpy function, which was missed in the Cuda FFT example.

Best regards

HI people :)

I’m a new here!

Another Delphi-s fan :D (my nickname means smth like “a man who wears Delphi’s skin” :P )

So, as it seems it’s not a problem to access CUDA runtime but still I have no idea how to make my own CUDA code work from Delphi without having to double calls by using a C-based dll. Is it impossible to use CU files as shaders in opengl getting compiler when main executable is run? I don’t need any in-code integration, so can anyone tell me how is it possible to make cuda work like common shaders do?

P.S. sorry 4 my bad English please :">

no, cu files can not be used as shaders. You have to call a c-based dll.

That’s a bad thing, so I’ll have to call as few functions as possible to minimise time taken by double CALL. Now I’ll test how slow dll-s work, a few PUSH, CALL, POP, RET… gotta write a benchmark. :)

Well, I use CUDA from MATLAB in the same manner, but I don’t see it as a problem.

Don’t know what do you use CUDA for, but the only thing I want to do at this time is to write a realtime raytracer, so every ns means much for me in this case, doesn’t it?

50 FPS => 20k ns per frame, so every ns is 0.005 % of the time you have per frame ;)

But indeed I am porting calculations that take more time.

Ok… but what I’m thinking about: as I know, Borland C++ Builder compiler can handle both Delphi and C source code and link them together, so is it possible to replace Delphi-s compiler with C++ bulder’s, “program” the compiler with a batch file to make a “mixed build”… do you think it could be possible? :spaz: :whistling: :spaz:

Actually CUDA needs visual C++ to work, so it would be quite useless. But maybe you can compile your C (with cuda) part with visual C++ to an object file and link that to Pascal? Just guessing here.

Guessing… I’m quite confused, this is nVIDIA’s official tech forum, isn’t this? And there is no one who works at CUDA project? None of nVIDIA’s developers are here who can answer this?

Now me and one my friend are trying to explore a sample CUDA project built by VS2005, maybe we’ll me able to see how CUDA methods are implemented?

Well, as CUDA is supported only with Visual C++ on windows, and gcc on linux & mac, they will likely not be able to answer you. When you want to use something in a non-supported manner, it will be you doing the discovering. And linking an object file (generated with VC++) from pascal is not really CUDA-related, more Pascal/Delphi related.

Well, I’m not asking them “how to use CUDA from Delphi”, but how it works at low level? For many developers VS integration might be a nice thing, but I like when everything is controllable, maybe it takes more time but none of algorithms can optimize a parallel computation code better than human brain does. Hope our small team at university will find a way to compile CU files separately and still we home one of nVIDIA developers will explain how a method’s code is sent to GPU via CUDART.dll

One more question: if one learns GT200-s ASM language, is it possible to control all video cards resources?

so why can’t you just use the driver API?

You say I can do GPU calculations simply via Driver API? but in case if I know GPU asm, am I right? So… could you link me to a documentation of GT200 architecture and instruction set?

Last one year I’ve been writing a project using Atmel RISC AVR-s and my brain turned like I want or not I cannot write a code without thinking what happens at low level

It I learn that all… what a nice thing would be