Skip to content

Instantly share code, notes, and snippets.

@alimuldal
Last active April 5, 2020 10:25
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alimuldal/eb0f4eea8af331b2a890 to your computer and use it in GitHub Desktop.
Save alimuldal/eb0f4eea8af331b2a890 to your computer and use it in GitHub Desktop.
test script for numpy BLAS linkage
#!/usr/bin/env python
import numpy
from numpy.distutils.system_info import get_info
import sys
import timeit
print("version: %s" % numpy.__version__)
print("maxint: %i\n" % sys.maxsize)
info = get_info('blas_opt')
print('BLAS info:')
for kk, vv in info.items():
print(' * ' + kk + ' ' + str(vv))
setup = "import numpy; x = numpy.random.random((1000, 1000))"
count = 10
t = timeit.Timer("numpy.dot(x, x.T)", setup=setup)
print("\ndot: %f sec" % (t.timeit(count) / count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment