How do I make this code GPU capable
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Respuestas (1)
Tony Mohan Varghese
el 29 de Nov. de 2017
Refer to GPU Capabilities and performance in MATLAB Documentation :
There are built in functions that you can use to improve your code :
0 comentarios
Ver también
Categorías
Más información sobre GPU Computing in MATLAB en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!