why using gpu.Array.zeros I have error Undefined variable "parallel" or class "parallel.​gpu.gpuArr​ay.zeros" ?

조회 수: 1 (최근 30일)
the line of the code is: gpu = gpuDevice(); Z = parallel.gpu.gpuArray.zeros(8192, 1); Undefined variable "parallel" or class "parallel.gpu.gpuArray.zeros".

채택된 답변

Jill Reese
Jill Reese 2013년 4월 2일
What version of MATLAB are you using?
In R2010b-R2012a releases, the GPU object was named parallel.gpu.GPUArray. In those releases you would create an array of all zeros on the GPU using:
z = parallel.gpu.GPUArray.zeros(8192,1);
In R2012b, the GPU object was renamed to gpuArray, so in R2012b and onward you would create the same array using this line of code:
z = gpuArray.zeros(8192,1);
  댓글 수: 2
Anastasiia
Anastasiia 2013년 4월 2일
I found my mistake: I used z = parallel.gpu.gpuArray.zeros(8192,1); but the rigth is z = parallel.gpu.GPUArray.zeros(8192,1);
So the problem was in the non-capital letters '..gpuArray..'
Thank you!

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

추가 답변 (0개)

카테고리

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