Hello, I am trying to wright a variable directly on the GPU using the following command:

A5 = parallel.gpu.GPUArray.rand(3000,3000);
but I get the following error:
Undefined variable "parallel" or class "parallel.gpu.GPUArray.rand". I don't know why I get this error. I am using Matlab 2015b. Could someone help me?

回答 (2 件)

Jan
Jan 2016 年 11 月 22 日
編集済み: Jan 2016 年 11 月 22 日

0 投票

Do you have the Parallel Processing Toolbox installed and licensed? Check this by the ver command.
Edric Ellis
Edric Ellis 2016 年 11 月 23 日
That's the old syntax from R2011a or so. In R2015b, you can do simply:
A5 = rand(3000, 3000, 'gpuArray');
(The direct equivalent is gpuArray.rand(3000,3000)).

2 件のコメント

FRANCESCO DE VIVO
FRANCESCO DE VIVO 2016 年 11 月 23 日
yes but this way you are passing from CPU to GPU, is it wright? My goal is to create directly the variable on the GPU saving time avoiding the passage
Sean de Wolski
Sean de Wolski 2016 年 11 月 23 日
Both of these create the array directly on the GPU.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeParallel Computing についてさらに検索

質問済み:

2016 年 11 月 22 日

コメント済み:

2016 年 11 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by