summaryrefslogtreecommitdiff
path: root/bitsandbytes/cextension.py
blob: 63d627e9c6f8ea4e94216991fa37454b18b87c4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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