Matlab pdist2 and mvnpdf with gpuArray

272 Views Asked by At

I have trouble using the pdist2 or mvnpdf functions of the Statistics and Machine Learning Toolbox with gpuArrays, although its explicitly stated that it should work:

https://de.mathworks.com/help/stats/statistics-and-machine-learning-toolbox-functions-with-gpuarray-arguments.html

How can I make this work?

data = randn(100,5);
mu = mean(data);

data = gpuArray(data);
mu = gpuArray(mu);

dist = pdist2(data, mu, 'euclidean')

Without gpuArrays, there is no problem with using the 2 functions.

Thanks for your help.

Edit

I am getting the following error:

Warning: Converting non-floating point data to double. 
> In pdist2 (line 228) 
Error using pdist2mex
X and Y inputs to PDIST2MEX must both be double, or both be single.

Error in pdist2 (line 352)
        D =
        pdist2mex(X',Y',dist,additionalArg,smallestLargestFlag,radius);
0

There are 0 best solutions below