Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
2e17e850
Commit
2e17e850
authored
7 years ago
by
Lianmin Zheng
Committed by
Tianqi Chen
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add query for shared memory size (#1083)
parent
3d67ea17
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/tvm/runtime/device_api.h
+2
-1
2 additions, 1 deletion
include/tvm/runtime/device_api.h
python/tvm/_ffi/runtime_ctypes.py
+7
-1
7 additions, 1 deletion
python/tvm/_ffi/runtime_ctypes.py
src/runtime/cuda/cuda_device_api.cc
+5
-0
5 additions, 0 deletions
src/runtime/cuda/cuda_device_api.cc
with
14 additions
and
2 deletions
include/tvm/runtime/device_api.h
+
2
−
1
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 */
...
...
This diff is collapsed.
Click to expand it.
python/tvm/_ffi/runtime_ctypes.py
+
7
−
1
View file @
2e17e850
...
...
@@ -140,6 +140,12 @@ class TVMContext(ctypes.Structure):
return
_api_internal
.
_GetDeviceAttr
(
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.
"""
...
...
This diff is collapsed.
Click to expand it.
src/runtime/cuda/cuda_device_api.cc
+
5
−
0
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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment