-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL][CUDA] Add test for a multi-device context #1102
base: intel
Are you sure you want to change the base?
Conversation
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); |
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.
What is the main purpose of the test? Can we use explict q.wait()
to eliminate the need for all the events?
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.
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.
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.
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?
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.
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.
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.
Also using waits would not make code much more readable, as there would need to be a wait call after every operation.
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.
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?
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.
I could imagine a deadlock.
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.
Something completely unexpected is also always an option.
Co-authored-by: aelovikov-intel <[email protected]>
Test for intel/llvm#6446.