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
OpenDAS
dgl
Commits
351f7588
Commit
351f7588
authored
May 13, 2023
by
lisj
Browse files
处理kDLROCM有关的函数注册
parent
aaaecbc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
include/dgl/runtime/ndarray.h
include/dgl/runtime/ndarray.h
+1
-1
src/runtime/c_runtime_api.cc
src/runtime/c_runtime_api.cc
+1
-1
src/runtime/cuda/cuda_device_api.cc
src/runtime/cuda/cuda_device_api.cc
+6
-0
No files found.
include/dgl/runtime/ndarray.h
View file @
351f7588
...
@@ -600,7 +600,7 @@ inline const char* TypeCode2Str(int type_code) {
...
@@ -600,7 +600,7 @@ inline const char* TypeCode2Str(int type_code) {
inline
const
char
*
DeviceTypeCode2Str
(
DLDeviceType
device_type
)
{
inline
const
char
*
DeviceTypeCode2Str
(
DLDeviceType
device_type
)
{
switch
(
device_type
)
{
switch
(
device_type
)
{
case
kDLCPU
:
return
"cpu"
;
case
kDLCPU
:
return
"cpu"
;
case
kDL
ROCM
:
return
"cuda"
;
case
kDL
GPU
:
return
"cuda"
;
case
kDLCPUPinned
:
return
"cpu_pinned"
;
case
kDLCPUPinned
:
return
"cpu_pinned"
;
case
kDLOpenCL
:
return
"opencl"
;
case
kDLOpenCL
:
return
"opencl"
;
case
kDLVulkan
:
return
"vulkan"
;
case
kDLVulkan
:
return
"vulkan"
;
...
...
src/runtime/c_runtime_api.cc
View file @
351f7588
...
@@ -27,7 +27,7 @@ namespace runtime {
...
@@ -27,7 +27,7 @@ namespace runtime {
inline
std
::
string
DeviceName
(
int
type
)
{
inline
std
::
string
DeviceName
(
int
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
kDLCPU
:
return
"cpu"
;
case
kDLCPU
:
return
"cpu"
;
case
kDL
ROCM
:
return
"gpu"
;
case
kDL
GPU
:
return
"gpu"
;
case
kDLOpenCL
:
return
"opencl"
;
case
kDLOpenCL
:
return
"opencl"
;
case
kDLSDAccel
:
return
"sdaccel"
;
case
kDLSDAccel
:
return
"sdaccel"
;
case
kDLAOCL
:
return
"aocl"
;
case
kDLAOCL
:
return
"aocl"
;
...
...
src/runtime/cuda/cuda_device_api.cc
View file @
351f7588
...
@@ -335,5 +335,11 @@ DGL_REGISTER_GLOBAL("device_api.gpu")
...
@@ -335,5 +335,11 @@ DGL_REGISTER_GLOBAL("device_api.gpu")
*
rv
=
static_cast
<
void
*>
(
ptr
);
*
rv
=
static_cast
<
void
*>
(
ptr
);
});
});
DGL_REGISTER_GLOBAL
(
"device_api.rocm"
)
.
set_body
([](
DGLArgs
args
,
DGLRetValue
*
rv
)
{
DeviceAPI
*
ptr
=
CUDADeviceAPI
::
Global
().
get
();
*
rv
=
static_cast
<
void
*>
(
ptr
);
});
}
// namespace runtime
}
// namespace runtime
}
// namespace dgl
}
// namespace dgl
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