Tesla GPU compute interpolation optimisation
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Good day all,
I have a piece of code from a image processing algorithm which runs the interp2 command as its main function. To speed up the evaluation of interp2 I have written the code that its inputs are all gpu arrays. This allows interp2 to execute as a gpu optimised function. There are a total of 2500 images to be analysed and even though 'gpuArray' has sped up the process, it is still a bit too slow. I have noticed that the code still evaluates each image one by one rather than a large portion in parallel which should be the beauty behind gpu compute. Is there a way to evaluate all 2500 images in parallel aka in one big batch? I have a Tesla K20c with 2496 CUDA cores. Any help would be very appreciated.
Here is the code:
%%%if true %%%
function [Ii,Ii1d, xaxisi, yaxisi] = speclet_GUI_v2(I, X, Y, x_axis_interp, y_min, y_max, ysize, method)
if (y_max-y_min)<1
[xi, yi] = gpuArray(meshgrid(x_axis_interp, (y_max+y_min)/2));
else
dy = abs(y_max - y_min)/(ysize-1);
[xi, yi] = meshgrid(x_axis_interp, y_min:dy:y_max);
end
% I = gpuArray(I);
% X = gpuArray(X);
% Y = gpuArray(Y);
% interpolate
Ii = interp2(X,Y,I,xi,yi,'linear');
% extract 1d data averaging along columns
Ii1d = mean(Ii,1);
xaxisi = xi(1,:);
yaxisi = yi(:,1)'; %both are row vectors
end
3 Commenti
Joss Knight
il 18 Lug 2017
It'll do as much as you can fit into memory. Yes, interpn supports gpuArray inputs.
Risposte (0)
Vedere anche
Categorie
Scopri di più su GPU Computing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!