Created
February 21, 2017 10:06
-
-
Save omegahm/97900e43b7e42b54b4bc5f83848d49f5 to your computer and use it in GitHub Desktop.
Testing BLAS extension for Bohrium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = np.random.rand(2000, 3000).astype(np.float32) | |
b = np.random.rand(3000, 4000).astype(np.float32) | |
t0 = time() | |
c = np.dot(a, b) | |
t1 = time() | |
print "[Numpy] It took {}s".format(t1-t0) | |
print c | |
a = bh.array(a) | |
b = bh.array(b) | |
bh.flush() | |
bh.flush() | |
t0 = time() | |
c = bh.blas.gemm(a, b) | |
bh.flush() | |
t1 = time() | |
print "[Bohrium EXT] It took {}s".format(t1-t0) | |
print c | |
bh.flush() | |
t0 = time() | |
c = bh.dot(a, b) | |
bh.flush() | |
t1 = time() | |
print "[Bohrium DOT] It took {}s".format(t1-t0) | |
#print c | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment