Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][CUDA] Add test for a multi-device context #1102

Open
wants to merge 13 commits into
base: intel
Choose a base branch
from

Conversation

t4c1
Copy link

@t4c1 t4c1 commented Jul 15, 2022

Test for intel/llvm#6446.

sycl::event e2 = q2.memcpy(usm2, &d, 1);

// test combination of usm and buffers in a kernel
sycl::event e3 = add(q1, buff1, usm1, e1);

Choose a reason for hiding this comment

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

What is the main purpose of the test? Can we use explict q.wait() to eliminate the need for all the events?

Copy link
Author

Choose a reason for hiding this comment

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

To check that common operations work when using two devices within the same context, including transferring buffer data between the devices and waiting on event , associated with an operation on another device. So while we could change each event synchronization with a wait on one or both of the queues, that would reduce the scope of the test.

Choose a reason for hiding this comment

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

In this case, would the test somewhat reliably fail if we didn't pass the events around?

In other words, would race condition manifest itself on a reasonable HW with such small workloads?

Copy link
Author

Choose a reason for hiding this comment

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

I believe a race condition would be relatively unlikely to manifest in such a test. But I still prefer events, as a race condition is not the only possible mode of failure.

Copy link
Author

Choose a reason for hiding this comment

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

Also using waits would not make code much more readable, as there would need to be a wait call after every operation.

Choose a reason for hiding this comment

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

Every other, I think. Anyway, I'm fine with events.

as a race condition is not the only possible mode of failure

For my education, what are the others here?

Copy link
Author

Choose a reason for hiding this comment

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

I could imagine a deadlock.

Copy link
Author

Choose a reason for hiding this comment

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

Something completely unexpected is also always an option.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants