Created
February 24, 2021 17:07
-
-
Save inducer/2f8490b82128b0591fecf791edef66a6 to your computer and use it in GitHub Desktop.
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
# based on https://github.com/numpy/numpy/issues/18471#issuecomment-785019387 | |
import numpy | |
import os | |
import ctypes | |
def get_ilp64(): | |
if os.environ.get("NPY_USE_BLAS_ILP64", "0") == "0": | |
return None | |
if IS_32BIT: | |
raise RuntimeError("NPY_USE_BLAS_ILP64 set on 32-bit arch") | |
return "64_" | |
ilp64 = get_ilp64() | |
dll = ctypes.CDLL(numpy.core._multiarray_umath.__file__) | |
if ilp64 == "64_": | |
get_config = dll.openblas_get_config64_ | |
else: | |
get_config = dll.openblas_get_config | |
get_config.restype = ctypes.c_char_p | |
res = get_config() | |
print('OpenBLAS get_config returned', str(res)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment