Commit b8f9e4dc authored by dugupeiwen's avatar dugupeiwen
Browse files

Optimize environment variables

parent 14c3255c
Pipeline #1187 failed with stages
in 0 seconds
...@@ -51,7 +51,10 @@ class HLC(object): ...@@ -51,7 +51,10 @@ class HLC(object):
def __init__(self): def __init__(self):
# Lazily load the libHLC library # Lazily load the libHLC library
bitcode_path = os.path.join(sys.prefix, 'share', 'rocmtools') # sugon: fix bitcode path
default_bitcode_path = os.environ.get('ROCM_PATH', '/opt/rocm') + '/amdgcn/bitcode/'
bitcode_path = os.environ.get("NUMBA_ROCM_BC_PATH", default_bitcode_path)
# bitcode_path = os.path.join(sys.prefix, 'share', 'rocmtools')
assert os.path.exists(bitcode_path) and os.path.isdir(bitcode_path) assert os.path.exists(bitcode_path) and os.path.isdir(bitcode_path)
self.bitcode_path = bitcode_path self.bitcode_path = bitcode_path
dev_ctx = devices.get_context() dev_ctx = devices.get_context()
...@@ -60,7 +63,9 @@ class HLC(object): ...@@ -60,7 +63,9 @@ class HLC(object):
if self.hlc is None: if self.hlc is None:
try: try:
hlc = CDLL(os.path.join(sys.prefix, 'lib', 'librocmlite.so')) # sugon: add ROCMLITE_LIBRARY_PATH ENV.
# hlc = CDLL(os.path.join(sys.prefix, 'lib', 'librocmlite.so'))
hlc = CDLL(os.path.join(os.environ.get('ROCMLITE_LIBRARY_PATH', None), 'librocmlite.so'))
except OSError: except OSError:
raise ImportError("librocmlite.so cannot be found. Please " raise ImportError("librocmlite.so cannot be found. Please "
"install the roctools package by: " "install the roctools package by: "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment