필터 지우기
필터 지우기

access to a gpuArray from a MEX file?

조회 수: 2 (최근 30일)
Jim Mutch
Jim Mutch 2011년 7월 14일
I did a lot of work with CUDA MEX files before gpuArray was an option. Now I would like to simplify my interface to these MEX files by allowing them to access data that the user has stored in gpuArrays -- but I do not want to rewrite all my code.
So: what I need is a way for my MEX code to access a gpuArray's internal pointer to GPU memory, and other metadata. Is there a way to do this?
I suppose I would also need access to the Parallel Computing Toolbox's CUDA context for this to work.

채택된 답변

Edric Ellis
Edric Ellis 2011년 7월 14일
You're right that you need Parallel Computing Toolbox to access gpuArray functionality. We don't offer a MEX interface with gpuArrays, but we do offer the CUDAKernel which allows you to use gpuArrays together with hand-written CUDA code. Here's the doc for CUDAKernel.
We think that CUDAKernel is easier to use than a MEX layer because you only need to write the "__global__" entry points for CUDA, you don't need to write any of the code to marshal data in and out of mxArrays.
  댓글 수: 4
Walter Roberson
Walter Roberson 2011년 11월 27일
King Fisher, I recommend that you start a new Question for this.
Daniel Armyr
Daniel Armyr 2013년 3월 18일
With the release of 2013a, though, you can do what the original poster wanted. See this: http://www.mathworks.se/help/distcomp/create-and-run-mex-files-containing-cuda-code.html

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

John Melonakos
John Melonakos 2011년 7월 17일
Jacket users have access to the Jacket SDK that has advantages over the other two approaches: http://blog.accelereyes.com/blog/2010/10/29/jacket_sdk_trumps_mex/
  댓글 수: 1
Jim Mutch
Jim Mutch 2011년 7월 17일
Perhaps, but in my question I said "I do not want to rewrite all my code". So this is off topic.
Do you guys need to pop up in every GPU-related thread?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by