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
96401072
Commit
96401072
authored
May 17, 2024
by
dugupeiwen
Browse files
Update ENV for DTK
parent
aceb5b43
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
numba/roc/hlc/config.py
numba/roc/hlc/config.py
+3
-1
numba/roc/hlc/hlc.py
numba/roc/hlc/hlc.py
+8
-0
numba/roc/hsadrv/driver.py
numba/roc/hsadrv/driver.py
+2
-3
No files found.
numba/roc/hlc/config.py
View file @
96401072
import
sys
import
sys
import
os
import
os
# sugon: adapt for DTK
# where ROCM bitcode is installed
# where ROCM bitcode is installed
DEFAULT_ROCM_BC_PATH
=
'/opt/rocm/opencl/lib/x86_64/bitcode/'
# DEFAULT_ROCM_BC_PATH = '/opt/rocm/opencl/lib/x86_64/bitcode/'
DEFAULT_ROCM_BC_PATH
=
os
.
environ
.
get
(
'ROCM_PATH'
,
'/opt/rocm'
)
+
'/amdgcn/bitcode/'
ROCM_BC_PATH
=
os
.
environ
.
get
(
"NUMBA_ROCM_BC_PATH"
,
DEFAULT_ROCM_BC_PATH
)
ROCM_BC_PATH
=
os
.
environ
.
get
(
"NUMBA_ROCM_BC_PATH"
,
DEFAULT_ROCM_BC_PATH
)
numba/roc/hlc/hlc.py
View file @
96401072
...
@@ -110,9 +110,17 @@ class CmdLine(object):
...
@@ -110,9 +110,17 @@ class CmdLine(object):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
_binary_path
=
os
.
environ
.
get
(
'HSAILBIN'
,
None
)
self
.
_binary_path
=
os
.
environ
.
get
(
'HSAILBIN'
,
None
)
# sugon: LLVM tools depend on DTK
self
.
_rocm_llvm_binary_path
=
os
.
environ
.
get
(
'ROCM_PATH'
,
'/opt/rocm'
)
+
"/llvm/bin"
if
not
os
.
path
.
exists
(
self
.
_rocm_llvm_binary_path
):
self
.
_rocm_llvm_binary_path
=
None
def
_setup_path
(
tool
):
def
_setup_path
(
tool
):
if
self
.
_binary_path
is
not
None
:
if
self
.
_binary_path
is
not
None
:
return
os
.
path
.
join
(
self
.
_binary_path
,
tool
)
return
os
.
path
.
join
(
self
.
_binary_path
,
tool
)
elif
self
.
_rocm_llvm_binary_path
is
not
None
:
return
os
.
path
.
join
(
self
.
_rocm_llvm_binary_path
,
tool
)
else
:
else
:
binpath
=
os
.
path
.
join
(
sys
.
prefix
,
'bin'
,
tool
)
binpath
=
os
.
path
.
join
(
sys
.
prefix
,
'bin'
,
tool
)
return
binpath
return
binpath
...
...
numba/roc/hsadrv/driver.py
View file @
96401072
...
@@ -36,9 +36,8 @@ def _device_type_to_string(device):
...
@@ -36,9 +36,8 @@ def _device_type_to_string(device):
except
IndexError
:
except
IndexError
:
return
'Unknown'
return
'Unknown'
# sugon: adapt for DTK
DEFAULT_HSA_DRIVER
=
'/opt/rocm/lib/libhsa-runtime64.so'
DEFAULT_HSA_DRIVER
=
os
.
environ
.
get
(
'ROCM_PATH'
,
'/opt/rocm'
)
+
'/lib/libhsa-runtime64.so'
def
_find_driver
():
def
_find_driver
():
envpath
=
os
.
environ
.
get
(
'NUMBA_HSA_DRIVER'
,
DEFAULT_HSA_DRIVER
)
envpath
=
os
.
environ
.
get
(
'NUMBA_HSA_DRIVER'
,
DEFAULT_HSA_DRIVER
)
...
...
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