简体   繁体   中英

CUDA with C++ Builder

How can I use CUDA with C++ builder? Do I have to use a wrapper to do a basic CUDA computation? I searched and there is no info how to set the CUDA SDK for C++ builder.

NVIDIA's API is C-compatible, and C++ builder compiles to native, they also happen to support conventional calling conventions for C.

CUDA has a kernel compiler that allows you to mix C/C++ code with CUDA code in the same file... but I think they sort of embed a gcc version in the toolkit. I had a project where I was mixing code produced by another gcc version, and the easiest thing was to isolate CUDA coda in a library that I compiled with their nvcc, and then linked with the code produced by my gcc version. In my case, I had it easy: the C++ compilers had in common calling and name-mangling convention.

So, you basically have three choices:

  1. Use CUDA's nvcc and gcc to generate C libraries that you can link with from C++ builder.

  2. Trick nvcc to generate C code and try to compile it with C++ builder. I didn't succeed on this however.

  3. Ditch C++ builder, you can still get nice multi-platform graphical user-interfaces using QT-creator with gcc/visual-studio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM