Error using rand function with gpu suport

1 view (last 30 days)
papar22
papar22 on 2 Dec 2015
Answered: Edric Ellis on 2 Dec 2015
Hi all together,
I am using rand function with gpu support as ( rand(size, type, 'gpuArray') ) with R2013a on the cluster. I receive the following error. "Error using rand Output class must be 'single' or 'double'." The point is that, when I run it locally on my machine, there is no error. The Matlab version of my machine is R2015b. It would be appreciated if someone let me know what the problem is? Is it related to matlab version or the property of the CUDA device on the server? Should I specify something to use the gpu in this case (ex. DriverVersion, ComputeCapability, etc)?
Any help would be appreciated. Bests

Answers (1)

Edric Ellis
Edric Ellis on 2 Dec 2015
The ability to call rand(size, type, 'gpuArray') was added in R2014a. This is mentioned in the MATLAB release notes for 14a - see the item "Support array-creation functions in your class".

Community Treasure Hunt

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

Start Hunting!