-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][CUDA] Using Custom context by default #1742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a couple of minor comments.
sycl/plugins/cuda/pi_cuda.cpp
Outdated
_pi_event::make_native(PI_COMMAND_TYPE_MEM_BUFFER_MAP, command_queue); | ||
(*retEvent)->record(); | ||
try { | ||
assert(command_queue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest moving it to the begging of the function(~line 3342).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. I have moved this assert to the beginning of the function.
sycl/source/detail/queue_impl.hpp
Outdated
enum class cuda_context_type : char { primary, custom }; | ||
|
||
/// Default context type created for CUDA backend | ||
const cuda_context_type DefaultContextType = cuda_context_type::custom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const cuda_context_type DefaultContextType = cuda_context_type::custom; | |
constexpr cuda_context_type DefaultContextType = cuda_context_type::custom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion has been applied to the commit. Thanks!
sycl/plugins/cuda/pi_cuda.cpp
Outdated
command_queue); | ||
(*retEvent)->record(); | ||
try { | ||
assert(command_queue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest moving it to the begging of the function(~line 3391).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has also been moved to the start of its function.
Performance analysis shows is better the default behaviour of SYCL Queues on CUDA backend is to use the non-primary context. Primary context will be exposed for interop with CUDA Runtime API on a separate extension as a property. Signed-off-by: Ruyman Reyes <[email protected]>
Signed-off-by: Ruyman Reyes <[email protected]>
c71bbfc
to
af5f78c
Compare
Performance analysis shows is better that the default behavior of
SYCL Queues on CUDA backend is to use the non-primary context.
Primary context will be exposed for interop with CUDA Runtime API
on a separate extension as a property.
Signed-off-by: Ruyman Reyes [email protected]