Skip to content

Commit

Permalink
Adding octave test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince781 committed Dec 15, 2017
1 parent 79a0543 commit 262efd5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/octave/sgemm.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
% computes GFLOPS

N = 2;
trials = 10;
while N <= 16384
elapsedTime = 0;
for i = 1:(1 + trials)
A = single(rand(N,N));
B = single(rand(N,N));
start = clock();
C = A * B;
if (i > 1)
elapsedTime += etime(clock(), start);
endif
endfor
gFlops = 2*N*N*N/(elapsedTime * 1e+9);
printf('OCTAVE SGEMM[n=%d]: elapsed=%f s GFLOPS=%f\n',
N, elapsedTime / trials, gFlops);
N = N * 2;
end

0 comments on commit 262efd5

Please sign in to comment.