kunzmi / managedCuda

ManagedCUDA aims an easy integration of NVidia's CUDA in .net applications written in C#, Visual Basic or any other .net language.
Other
440 stars 79 forks source link

32bit CUFFT #77

Closed chenw11 closed 4 years ago

chenw11 commented 4 years ago

I noticed there was a previous issue mentioned 32 bit development. I'm trying to develop a 32 bit software in 64 bit Windows OS. The reason is the limited 32 bit version of the API. As I have been searching, CUFFT does not support since CUDA 7.0. My question is how CUDAFFT.dll in ManagedCUDA was built. And can I build the same way using native library but into 32 bit? Thanks a lot.

kunzmi commented 4 years ago

In Cuda versions where Nvidia delivered the two kinds of its libraries (32/64 bit), the managedCuda wrappers also compiled for these two versions. So there is a 32 and a 64 bit version of CUDAFFT.dll for these old CUDA versions. If you checkout one of the older commits, you'll see that the main managedCuda part always compiles as 'AnyCPU' but for the libraries you have to set 32 or 64 bit explicitly for building. Finally, if you build the 32 bit version, you can use 32 bit CUFFT on a Windows 64 machine.

chenw11 commented 4 years ago

Hi kunzmi! Appreciate for the instant response and building such amazing project! The 64 bit CUDAFFT.dll I'm currently using was came along in the /sample/lib folder. I check the previous commit and not sure where to start to build 32 bit library. Do you mean I would need to download a older verison of Managedcuda, and build the 32 bit CudaFFT.dll by setting the environment into 32 bit in visual studio?

kunzmi commented 4 years ago

The older versions are no more accessible on NuGet why you'd need to compile them yourself. If you load the managedCuda.sln-solution in VisualStudio and compile using the NuGet_x86 environment settings, all libraries are compiled in x86 (or AnyCPU where possible). You also need the corresponding managedCuda.dll used to compile the CUDAFFT.dll because they depend on each other. (The x86 environment is configured to only compile the libraries without managedCuda.dll, hence NuGet_86). Once compilation done, you'll find all libraries in the build output directory.