Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
liupw
numba-DTK
Commits
b8f9e4dc
Commit
b8f9e4dc
authored
May 17, 2024
by
dugupeiwen
Browse files
Optimize environment variables
parent
14c3255c
Pipeline
#1187
failed with stages
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
numba/roc/hlc/libhlc.py
numba/roc/hlc/libhlc.py
+7
-2
No files found.
numba/roc/hlc/libhlc.py
View file @
b8f9e4dc
...
...
@@ -51,7 +51,10 @@ class HLC(object):
def
__init__
(
self
):
# 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
)
self
.
bitcode_path
=
bitcode_path
dev_ctx
=
devices
.
get_context
()
...
...
@@ -60,7 +63,9 @@ class HLC(object):
if
self
.
hlc
is
None
:
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
:
raise
ImportError
(
"librocmlite.so cannot be found. Please "
"install the roctools package by: "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment