Code covered by the BSD License  

Highlights from
MATLAB for CUDA Programmers

image thumbnail

MATLAB for CUDA Programmers

by

 

02 Oct 2012 (Updated )

This is the code used during the MATLAB for CUDA Programmers webinar

verify.m
%% Compare the two implementations
% Copyright 2013 The MathWorks, Inc.

%% Run the data through the two implementations
adjustedImageCPU = whitebalance(imageData);
adjustedImageGPU = whitebalance_gpu(imageData);

%% Visualize the results and their difference
subplot(1,2,1); imshow(adjustedImageCPU); title('CPU Output');
subplot(1,2,2); imshow(adjustedImageGPU); title('GPU Output');

difference = double(adjustedImageCPU(:) - adjustedImageGPU(:));
msgbox(['The norm of the difference is: ' num2str(norm(difference))]);

Contact us