Skip to content

Instantly share code, notes, and snippets.

@junjuew
Created September 13, 2016 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junjuew/51b311eb8bcdfe9b59e3e23fd8f11135 to your computer and use it in GitHub Desktop.
Save junjuew/51b311eb8bcdfe9b59e3e23fd8f11135 to your computer and use it in GitHub Desktop.
Test script to see whether your numpy is using fast or slow BLAS
#!/usr/bin/env python
import numpy
import sys
import timeit
try:
import numpy.core._dotblas
print 'FAST BLAS'
except ImportError:
print 'slow blas'
print "version:", numpy.__version__
print "maxint:", sys.maxint
print
x = numpy.random.random((1000,1000))
setup = "import numpy; x = numpy.random.random((1000,1000))"
count = 5
t = timeit.Timer("numpy.dot(x, x.T)", setup=setup)
print "dot:", t.timeit(count)/count, "sec"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment