Skip to content
Snippets Groups Projects
Commit 3257c45a authored by sundar's avatar sundar
Browse files

Getstats for MinMax

parent 836b5ca3
No related branches found
No related tags found
No related merge requests found
function results = Getstats_MinMax(img1,bytesize)
% Collects stats of performance and accuracy for CudaMex and Matlab
% implementations of MinMax
%
if (~exist('bytesize','var') || isempty(bytesize))
info = whos('img1');
bytesize = info.bytes;
end
minval=zeros(1,2);
maxval=zeros(1,2);
for i=1:2
if (i == 1)
useMatlab = 1;
else
useMatlab = 0;
end
results(i).process = 'MinMax';
if (useMatlab == 1)
results(i).Cuda_or_Matlab = 'MATLAB';
else
results(i).Cuda_or_Matlab = 'CUDA';
end
t1 = tic ;
[minval(i), maxval(i)] = MinMax(img1,1,useMatlab);
elapsedtime=toc(t1);
img_size = size(img1);
results(i).ImageSize = img_size;
results(i).timer = elapsedtime;
end
% Difference to check if addition by both methods result in same image
if ((minval(1) == minval(2)) && (maxval(1) == maxval(2)))
accuracy = 100;
else
accuracy = 0;
end
results(1).accuracy = accuracy;
results(2).accuracy = accuracy;
results(1).ByteSize = bytesize;
results(2).ByteSize = bytesize;
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment