Tesla GPU compute interpolation optimisation

2 次查看(过去 30 天)
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 个评论
Tobias Reichold
Tobias Reichold 2017-7-18
Hi Mr Knight,
I have not considered that option yet. Will this run all 2500 images in parallel? Is interpn also GPU compatible?
Joss Knight
Joss Knight 2017-7-18
It'll do as much as you can fit into memory. Yes, interpn supports gpuArray inputs.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 GPU Computing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by