cuFFT in Alea GPU

旧街凉风 提交于 2019-12-12 10:22:47

问题


I am using Alea GPU to program on GPU using C# language. I installed Alea 3.0.4 on Visual Studio 2017 project, but I can't find some cuFFT library. On NVidia's website stands cuFFT is part of CUDA Toolkit, so I don't need to download additional CUDA libraries. Do I need to downlaod some additional binding or it is possible to use cuFFT with Alea GPU?


回答1:


The bindings you're searching are here: https://www.nuget.org/packages/Alea.CudaToolkit/

In order for these to work you need to have CUDA Tooklit installed in your machine. (v7.5 or greater)

Here's an example on how to use it:

using Alea.CudaToolkit;

int plan;
int padSize = ...
SafeCall(CuFFT.cufftPlan1d(&plan, padSize, cufftType_t.CUFFT_C2C, 1));

or...

using Alea.CudaToolkit;

int handle;
SafeCall(CuFFT.cufftCreate(&handle));

SafeCall is defined as:

private static void SafeCall(cufftResult_t status)
{
    if (status != cufftResult_t.CUFFT_SUCCESS)
    {
        throw new InvalidOperationException(status.ToString());
    }
}


来源:https://stackoverflow.com/questions/45920630/cufft-in-alea-gpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!