Skip to content

[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

Merged
merged 2 commits into from
May 27, 2020

Conversation

Ruyk
Copy link
Contributor

@Ruyk Ruyk commented May 22, 2020

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]

@Ruyk Ruyk requested a review from a team as a code owner May 22, 2020 10:22
@Ruyk Ruyk requested a review from s-kanaev May 22, 2020 10:22
@Ruyk Ruyk requested a review from a team as a code owner May 22, 2020 12:48
@Ruyk Ruyk requested a review from romanovvlad May 22, 2020 12:48
@bader bader added the cuda CUDA back-end label May 25, 2020
Copy link
Contributor

@romanovvlad romanovvlad left a 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.

_pi_event::make_native(PI_COMMAND_TYPE_MEM_BUFFER_MAP, command_queue);
(*retEvent)->record();
try {
assert(command_queue);
Copy link
Contributor

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).

Copy link
Contributor

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.

enum class cuda_context_type : char { primary, custom };

/// Default context type created for CUDA backend
const cuda_context_type DefaultContextType = cuda_context_type::custom;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const cuda_context_type DefaultContextType = cuda_context_type::custom;
constexpr cuda_context_type DefaultContextType = cuda_context_type::custom;

Copy link
Contributor

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!

command_queue);
(*retEvent)->record();
try {
assert(command_queue);
Copy link
Contributor

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).

Copy link
Contributor

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.

Ruyk added 2 commits May 26, 2020 11:40
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]>
@steffenlarsen steffenlarsen force-pushed the cuda-context-not-primary branch from c71bbfc to af5f78c Compare May 26, 2020 11:11
@bader bader requested a review from romanovvlad May 26, 2020 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda CUDA back-end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants