diff options
author | Tim Dettmers <TimDettmers@users.noreply.github.com> | 2022-07-18 09:51:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 09:51:37 -0700 |
commit | 4cd7ea62b2f51c68aacde2f62e7141765e476111 (patch) | |
tree | 548b2e77c62acd152330e898a6e17ea949a156d1 /bitsandbytes/cextension.py | |
parent | 3418cd390e952a7752fb6b2544c25e25af7c0371 (diff) | |
parent | fd750cd2370b3b12e216a9148b23aaae63a80989 (diff) |
Merge pull request #3 from TimDettmers/cpuonly
Add a CPU-only build option
Diffstat (limited to 'bitsandbytes/cextension.py')
-rw-r--r-- | bitsandbytes/cextension.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitsandbytes/cextension.py b/bitsandbytes/cextension.py new file mode 100644 index 0000000..63d627e --- /dev/null +++ b/bitsandbytes/cextension.py @@ -0,0 +1,13 @@ +import ctypes as ct +import os +from warnings import warn + +lib = ct.cdll.LoadLibrary(os.path.dirname(__file__) + '/libbitsandbytes.so') + +try: + lib.cadam32bit_g32 + COMPILED_WITH_CUDA = True +except AttributeError: + warn("The installed version of bitsandbytes was compiled without GPU support. " + "8-bit optimizers and GPU quantization are unavailable.") + COMPILED_WITH_CUDA = False |