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
2e17e850
Commit
2e17e850
authored
Apr 07, 2018
by
Lianmin Zheng
Committed by
Tianqi Chen
Apr 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add query for shared memory size (#1083)
parent
3d67ea17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
include/tvm/runtime/device_api.h
+2
-1
python/tvm/_ffi/runtime_ctypes.py
+7
-1
src/runtime/cuda/cuda_device_api.cc
+5
-0
No files found.
include/tvm/runtime/device_api.h
View file @
2e17e850
...
...
@@ -19,7 +19,8 @@ enum DeviceAttrKind : int {
kExist
=
0
,
kMaxThreadsPerBlock
=
1
,
kWarpSize
=
2
,
kComputeVersion
=
3
,
kMaxSharedMemoryPerBlock
=
3
,
kComputeVersion
=
4
,
};
/*! \brief Number of bytes each allocation must align to */
...
...
python/tvm/_ffi/runtime_ctypes.py
View file @
2e17e850
...
...
@@ -141,6 +141,12 @@ class TVMContext(ctypes.Structure):
self
.
device_type
,
self
.
device_id
,
2
)
@property
def
max_shared_memory_per_block
(
self
):
"""Total amount of shared memory per block in bytes"""
return
_api_internal
.
_GetDeviceAttr
(
self
.
device_type
,
self
.
device_id
,
3
)
@property
def
compute_version
(
self
):
"""Get compute verison number in string.
...
...
@@ -152,7 +158,7 @@ class TVMContext(ctypes.Structure):
The version string in `major.minor` format.
"""
return
_api_internal
.
_GetDeviceAttr
(
self
.
device_type
,
self
.
device_id
,
3
)
self
.
device_type
,
self
.
device_id
,
4
)
def
sync
(
self
):
"""Synchronize until jobs finished at the context."""
...
...
src/runtime/cuda/cuda_device_api.cc
View file @
2e17e850
...
...
@@ -40,6 +40,11 @@ class CUDADeviceAPI final : public DeviceAPI {
&
value
,
cudaDevAttrWarpSize
,
ctx
.
device_id
));
break
;
}
case
kMaxSharedMemoryPerBlock
:
{
CUDA_CALL
(
cudaDeviceGetAttribute
(
&
value
,
cudaDevAttrMaxSharedMemoryPerBlock
,
ctx
.
device_id
));
break
;
}
case
kComputeVersion
:
{
std
::
ostringstream
os
;
CUDA_CALL
(
cudaDeviceGetAttribute
(
...
...
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