Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
0235d283
Commit
0235d283
authored
Nov 14, 2019
by
Peter Yeh
Committed by
masahi
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RUNTIME] Add device query for AMD GcnArch (#4341)
* add gcnArch query * kGcnArch query for cuda is a no-op
parent
1e2c525b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
8 deletions
+17
-8
include/tvm/runtime/device_api.h
+2
-1
src/codegen/llvm/codegen_amdgpu.cc
+1
-1
src/runtime/cuda/cuda_device_api.cc
+1
-0
src/runtime/metal/metal_device_api.mm
+1
-0
src/runtime/opencl/opencl_device_api.cc
+1
-0
src/runtime/opengl/opengl_device_api.cc
+1
-0
src/runtime/rocm/rocm_device_api.cc
+8
-6
src/runtime/vulkan/vulkan.cc
+2
-0
No files found.
include/tvm/runtime/device_api.h
View file @
0235d283
...
...
@@ -42,7 +42,8 @@ enum DeviceAttrKind : int {
kDeviceName
=
5
,
kMaxClockRate
=
6
,
kMultiProcessorCount
=
7
,
kMaxThreadDimensions
=
8
kMaxThreadDimensions
=
8
,
kGcnArch
=
9
};
/*! \brief Number of bytes each allocation must align to */
...
...
src/codegen/llvm/codegen_amdgpu.cc
View file @
0235d283
...
...
@@ -174,7 +174,7 @@ inline int DetectROCMComputeVersion(const std::string& target) {
TVMRetValue
val
;
api
->
GetAttr
(
tvm_ctx
,
tvm
::
runtime
::
kExist
,
&
val
);
if
(
val
.
operator
int
()
==
1
)
{
tvm
::
runtime
::
DeviceAPI
::
Get
(
tvm_ctx
)
->
GetAttr
(
tvm_ctx
,
tvm
::
runtime
::
k
ComputeVersion
,
&
val
);
tvm
::
runtime
::
DeviceAPI
::
Get
(
tvm_ctx
)
->
GetAttr
(
tvm_ctx
,
tvm
::
runtime
::
k
GcnArch
,
&
val
);
return
val
.
operator
int
();
}
}
...
...
src/runtime/cuda/cuda_device_api.cc
View file @
0235d283
...
...
@@ -105,6 +105,7 @@ class CUDADeviceAPI final : public DeviceAPI {
*
rv
=
ss
.
str
();
return
;
}
case
kGcnArch
:
return
;
}
*
rv
=
value
;
}
...
...
src/runtime/metal/metal_device_api.mm
View file @
0235d283
...
...
@@ -63,6 +63,7 @@ void MetalWorkspace::GetAttr(
case kMultiProcessorCount: return;
case kMaxThreadDimensions: return;
case kExist: break;
case kGcnArch: return;
}
}
...
...
src/runtime/opencl/opencl_device_api.cc
View file @
0235d283
...
...
@@ -114,6 +114,7 @@ void OpenCLWorkspace::GetAttr(
*
rv
=
ss
.
str
();
break
;
}
case
kGcnArch
:
return
;
}
}
...
...
src/runtime/opengl/opengl_device_api.cc
View file @
0235d283
...
...
@@ -117,6 +117,7 @@ void OpenGLWorkspace::GetAttr(
case
kMaxClockRate
:
return
;
case
kMultiProcessorCount
:
return
;
case
kMaxThreadDimensions
:
return
;
case
kGcnArch
:
return
;
}
}
...
...
src/runtime/rocm/rocm_device_api.cc
View file @
0235d283
...
...
@@ -26,9 +26,10 @@
#include <dmlc/logging.h>
#include <dmlc/thread_local.h>
#include <tvm/runtime/registry.h>
#include <hip/hip_runtime_api.h>
#include <hsa/hsa.h>
#include <tvm/runtime/registry.h>
#include "../../../include/tvm/runtime/device_api.h"
#include "rocm_common.h"
namespace
tvm
{
...
...
@@ -62,16 +63,17 @@ class ROCMDeviceAPI final : public DeviceAPI {
break
;
}
case
kMaxSharedMemoryPerBlock
:
return
;
case
kComputeVersion
:
{
case
kComputeVersion
:
case
kDeviceName
:
return
;
case
kMaxClockRate
:
return
;
case
kMultiProcessorCount
:
return
;
case
kMaxThreadDimensions
:
return
;
case
kGcnArch
:
{
hipDeviceProp_t
prop
;
ROCM_CALL
(
hipGetDeviceProperties
(
&
prop
,
ctx
.
device_id
));
*
rv
=
prop
.
gcnArch
;
return
;
}
case
kDeviceName
:
return
;
case
kMaxClockRate
:
return
;
case
kMultiProcessorCount
:
return
;
case
kMaxThreadDimensions
:
return
;
}
*
rv
=
value
;
}
...
...
src/runtime/vulkan/vulkan.cc
View file @
0235d283
...
...
@@ -398,6 +398,8 @@ void VulkanDeviceAPI::GetAttr(TVMContext ctx, DeviceAttrKind kind, TVMRetValue*
break
;
case
kMaxThreadDimensions
:
break
;
case
kGcnArch
:
return
;
}
}
...
...
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