How do I make this code GPU capable

We are trying to take advantage of the GPU for increase processing speed. As a test, we are trying to convert the following code to utilize the GPU:
clear all; close all; clc;
variables =1000; data = 60;
X = rand(variables, data);
Y = rand(data, 1);
distcomp.feature( 'LocalUseMpiexec', false ); delete(gcp('nocreate')); parpool(4); pctRunOnAll warning('off','all')
disp('CPU started'); tic;
parfor j= [1:variables]
mdl = fitlm( X([ j ],:) , Y , 'linear','RobustOpts','off');
Rsq(j) = mdl.Rsquared.Adjusted;
Rmse(j) =mdl.RMSE;
end
toc
disp('CPU ended');
Any assistance would be greatly appreciated.

1 commentaire

Matt J
Matt J le 16 Nov 2017
Modifié(e) : Matt J le 16 Nov 2017
It doesn't look to me like it would benefit from the GPU. Parfor is a good choice for the operations that you've shown.

Connectez-vous pour commenter.

Réponses (1)

Catégories

En savoir plus sur Parallel Computing dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by