Accessing complex workspace data from a CUDA kernel
2 次查看(过去 30 天)
显示 更早的评论
In my MATLAB workspace, I have some complex data that I wish to transfer to the GPU for further processing with a CUDA kernel. Transferring the data to the GPU is easy with the gpuArray command.
However, what data type should I specify in the .cu kernel prototype to access a complex gpuArray? In the Parallel Computing Toolbox documentation, cuComplex is not listed as a supported data type for the C prototype, and when I use float2 I receive an error message about the complexity of the input not matching the prototype:
"parallel.gpu.GPUArray must match the complexity specified on the kernel prototype"
Regards, Jeremy Dillon
1 个评论
King Fisher
2011-11-27
Have you written CUDA Kernel? and you are activating it by parallel.gpu.kernel('.ptx','.cu') command? if yes Would you please share your code?
采纳的回答
Edric Ellis
2011-11-7
You should use 'double2' to match complex double MATLAB data, and 'float2' for complex single MATLAB data.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!