ZQPei commented on a change in pull request #9544:
URL: https://github.com/apache/tvm/pull/9544#discussion_r753803970
##########
File path: python/tvm/target/target.py
##########
@@ -139,6 +142,14 @@ def current(allow_none=True):
"""
return _ffi_api.TargetCurrent(allow_none)
+ def enter_cuda_scope(self):
+ if self.arch:
+ set_cuda_target_arch(self.arch)
+
+ @property
+ def arch(self):
Review comment:
There is alreadya `arch` attribute in target class in the C++ side, and
I am simply adding a python API of it.
If it is not CUDA target, `target.arch` will be None by default.
##########
File path: python/tvm/target/target.py
##########
@@ -139,6 +142,14 @@ def current(allow_none=True):
"""
return _ffi_api.TargetCurrent(allow_none)
+ def enter_cuda_scope(self):
+ if self.arch:
+ set_cuda_target_arch(self.arch)
+
+ @property
+ def arch(self):
Review comment:
There is already an `arch` attribute in target class in the C++ side,
and I am simply adding a python API of it.
If it is not CUDA target, `target.arch` will be None by default.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]