function HelloWorld() % Include Libra SDK/include/matlab interface (language bindings) oldPath = cd(pwd); cd .. cd .. cd .. addpath([pwd '/include/matlab/']); disp('*****************************'); disp('DGEMM : matrix multiplication'); disp('*****************************'); % Point out /LibraSDK/ root ret = libra_init(pwd, {''}); cd(oldPath); if (ret > 0) exit; end N = 1024; libra_setDefaultDataType(GFLOAT64.value); % Create two N by N matrices. A = libra_ones(N); B = A; % warm up (to get accurate timing results) C = A * B; C = A * B; C = A * B; C = A * B; startTime = libra_GetTime(); % Perform matrix multiplication using double precision C = A * B; time = libra_GetTime() - startTime; disp('Total time (ms) : ');time*1000 % Compute a performance measurement. Gigaflop / s. flopCount = (2*N-1)*N*N; gflops = flopCount / time / 1e9 disp('GFlop/s.'); end