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

[SYCL] Adjust multiple tests to queue::wait() changes #338

Merged
merged 6 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions SYCL/Basic/queue/release.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ int main() {
return 0;
}

//CHECK: ---> piEnqueueKernelLaunch(
//CHECK: ---> piQueueRelease(
//CHECK: ---> piEventRelease(
//CHECK: ---> piContextRelease(
//CHECK: ---> piKernelRelease(
//CHECK: ---> piProgramRelease(
//CHECK: ---> piDeviceRelease(
// CHECK: ---> piEnqueueKernelLaunch(
// FIXME the order of these 2 varies between plugins due to a Level Zero
// specific queue workaround.
// CHECK-DAG: ---> piEventRelease(
// CHECK-DAG: ---> piQueueRelease(
// CHECK: ---> piContextRelease(
// CHECK: ---> piKernelRelease(
// CHECK: ---> piProgramRelease(
// CHECK: ---> piDeviceRelease(
14 changes: 7 additions & 7 deletions SYCL/Basic/subdevice_pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static bool check_separate(device dev, buffer<int, 1> buf,
// CHECK-SEPARATE: ---> piQueueCreate
// CHECK-SEPARATE: ---> piMemBufferCreate
// CHECK-SEPARATE: ---> piEnqueueKernelLaunch
// CHECK-SEPARATE: ---> piEventsWait
// CHECK-SEPARATE: ---> piQueueFinish

log_pi("Test sub device 1");
{
Expand All @@ -78,7 +78,7 @@ static bool check_separate(device dev, buffer<int, 1> buf,
// CHECK-SEPARATE: ---> piEnqueueMemBufferWrite
//
// CHECK-SEPARATE: ---> piEnqueueKernelLaunch
// CHECK-SEPARATE: ---> piEventsWait
// CHECK-SEPARATE: ---> piQueueFinish

return true;
}
Expand Down Expand Up @@ -113,7 +113,7 @@ static bool check_shared_context(device dev, buffer<int, 1> buf,
// see --implicit-check-not above.
//
// CHECK-SHARED: ---> piEnqueueKernelLaunch
// CHECK-SHARED: ---> piEventsWait
// CHECK-SHARED: ---> piQueueFinish

log_pi("Test sub device 1");
{
Expand All @@ -123,7 +123,7 @@ static bool check_shared_context(device dev, buffer<int, 1> buf,
// CHECK-SHARED: Test sub device 1
// CHECK-SHARED: ---> piQueueCreate
// CHECK-SHARED: ---> piEnqueueKernelLaunch
// CHECK-SHARED: ---> piEventsWait
// CHECK-SHARED: ---> piQueueFinish
// CHECK-SHARED: ---> piEnqueueMemBufferRead

return true;
Expand Down Expand Up @@ -162,7 +162,7 @@ static bool check_fused_context(device dev, buffer<int, 1> buf,
// *and* the root device): see --implicit-check-not above.
//
// CHECK-FUSED: ---> piEnqueueKernelLaunch
// CHECK-FUSED: ---> piEventsWait
// CHECK-FUSED: ---> piQueueFinish

log_pi("Test sub device 0");
{
Expand All @@ -172,7 +172,7 @@ static bool check_fused_context(device dev, buffer<int, 1> buf,
// CHECK-FUSED: Test sub device 0
// CHECK-FUSED: ---> piQueueCreate
// CHECK-FUSED: ---> piEnqueueKernelLaunch
// CHECK-FUSED: ---> piEventsWait
// CHECK-FUSED: ---> piQueueFinish

log_pi("Test sub device 1");
{
Expand All @@ -182,7 +182,7 @@ static bool check_fused_context(device dev, buffer<int, 1> buf,
// CHECK-FUSED: Test sub device 1
// CHECK-FUSED: ---> piQueueCreate
// CHECK-FUSED: ---> piEnqueueKernelLaunch
// CHECK-FUSED: ---> piEventsWait
// CHECK-FUSED: ---> piQueueFinish
// CHECK-FUSED: ---> piEnqueueMemBufferRead

return true;
Expand Down
71 changes: 41 additions & 30 deletions SYCL/Plugin/enqueue-arg-order-image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ void testcopyH2DImage() {
writeAcc.write(int(Item[0]), Data);
});
});
otherQueue.wait();
std::cout << "about to destruct 1D" << std::endl;
} // ~image 1D

Expand Down Expand Up @@ -224,6 +225,7 @@ void testcopyH2DImage() {
writeAcc.write(sycl::int2{Item[0], Item[1]}, Data);
});
});
otherQueue.wait();
std::cout << "about to destruct 2D" << std::endl;
} // ~image 2D

Expand Down Expand Up @@ -260,6 +262,7 @@ void testcopyH2DImage() {
writeAcc.write(sycl::int4{Item[0], Item[1], Item[2], 0}, Data);
});
});
otherQueue.wait();
std::cout << "about to destruct 3D" << std::endl;
} // ~image 3D

Expand All @@ -279,6 +282,7 @@ int main() {

// ----------- IMAGES

// clang-format off
//CHECK: start copyD2H-Image
//CHECK: -- 1D
//CHECK: ---> piMemImageCreate(
Expand Down Expand Up @@ -319,14 +323,16 @@ int main() {
//CHECK: image_desc w/h/d : 16 / 1 / 1 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4340
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/1/1
//CHECK: ---> piEnqueueMemImageWrite(
//CHECK: pi_image_region width/height/depth : 16/1/1
//CHECK: ---> piMemImageCreate(
//CHECK: image_desc w/h/d : 16 / 1 / 1 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4340
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/1/1
//CHECK: ---> piEnqueueMemImageWrite(
//CHECK: pi_image_region width/height/depth : 16/1/1
// The order of the following calls may vary since some of them are made by a
// host task (in a separate thread).
//CHECK-DAG: ---> piMemImageCreate(
//CHECK-DAG: image_desc w/h/d : 16 / 1 / 1 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4340
//CHECK-DAG: ---> piEnqueueMemImageRead(
//CHECK-DAG: pi_image_region width/height/depth : 16/1/1
//CHECK-DAG: ---> piEnqueueMemImageWrite(
//CHECK-DAG: pi_image_region width/height/depth : 16/1/1
//CHECK-DAG: ---> piEnqueueMemImageWrite(
//CHECK-DAG: pi_image_region width/height/depth : 16/1/1
//CHECK: about to destruct 1D
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/1/1
Expand All @@ -339,16 +345,18 @@ int main() {
//CHECK: image_desc w/h/d : 16 / 5 / 1 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4337
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/5/1
//CHECK: ---> piEnqueueMemImageWrite(
//CHECK: pi_image_region width/height/depth : 16/5/1
// CHECK-NEXT: <unknown> : 256
//CHECK: ---> piMemImageCreate(
//CHECK: image_desc w/h/d : 16 / 5 / 1 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4337
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/5/1
//CHECK: ---> piEnqueueMemImageWrite(
//CHECK: pi_image_region width/height/depth : 16/5/1
// CHECK-NEXT: <unknown> : 256
// The order of the following calls may vary since some of them are made by a
// host task (in a separate thread).
//CHECK-DAG: ---> piMemImageCreate(
//CHECK-DAG: image_desc w/h/d : 16 / 5 / 1 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4337
//CHECK-DAG: ---> piEnqueueMemImageRead(
//CHECK-DAG: pi_image_region width/height/depth : 16/5/1
//CHECK-DAG: ---> piEnqueueMemImageWrite(
//CHECK-DAG: pi_image_region width/height/depth : 16/5/1
//CHECK-DAG: <unknown> : 256
//CHECK-DAG: ---> piEnqueueMemImageWrite(
//CHECK-DAG: pi_image_region width/height/depth : 16/5/1
//CHECK-DAG: <unknown> : 256
//CHECK: about to destruct 2D
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/5/1
Expand All @@ -361,21 +369,24 @@ int main() {
//CHECK: image_desc w/h/d : 16 / 5 / 3 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4338
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/5/3
//CHECK: ---> piEnqueueMemImageWrite(
//CHECK: pi_image_region width/height/depth : 16/5/3
// CHECK-NEXT: <unknown> : 256
// CHECK-NEXT: <unknown> : 1280
//CHECK: ---> piMemImageCreate(
//CHECK: image_desc w/h/d : 16 / 5 / 3 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4338
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/5/3
//CHECK: ---> piEnqueueMemImageWrite(
//CHECK: pi_image_region width/height/depth : 16/5/3
// CHECK-NEXT: <unknown> : 256
// CHECK-NEXT: <unknown> : 1280
// The order of the following calls may vary since some of them are made by a
// host task (in a separate thread).
//CHECK-DAG: ---> piMemImageCreate(
//CHECK-DAG: image_desc w/h/d : 16 / 5 / 3 -- arrSz/row/slice : 0 / 0 / 0 -- num_mip_lvls/num_smpls/image_type : 0 / 0 / 4338
//CHECK-DAG: ---> piEnqueueMemImageRead(
//CHECK-DAG: pi_image_region width/height/depth : 16/5/3
//CHECK-DAG: ---> piEnqueueMemImageWrite(
//CHECK-DAG: pi_image_region width/height/depth : 16/5/3
//CHECK-DAG: <unknown> : 256
//CHECK-DAG: <unknown> : 1280
//CHECK-DAG: ---> piEnqueueMemImageWrite(
//CHECK-DAG: pi_image_region width/height/depth : 16/5/3
//CHECK-DAG: <unknown> : 256
//CHECK-DAG: <unknown> : 1280
//CHECK: about to destruct 3D
//CHECK: ---> piEnqueueMemImageRead(
//CHECK: pi_image_region width/height/depth : 16/5/3
// CHECK-NEXT: <unknown> : 256
// CHECK-NEXT: <unknown> : 1280
//CHECK: end copyH2D-image
// clang-format on
4 changes: 2 additions & 2 deletions SYCL/Tracing/pi_tracing_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
int main() {
cl::sycl::queue Queue;
cl::sycl::buffer<int, 1> Buf(10);
Queue.submit([&](cl::sycl::handler &cgh) {
cl::sycl::event E = Queue.submit([&](cl::sycl::handler &cgh) {
auto Acc = Buf.template get_access<cl::sycl::access::mode::read_write>(cgh);

cgh.parallel_for<class CheckTraces>(
10, [=](cl::sycl::id<1> ID) { Acc[ID] = 5; });
});
Queue.wait();
E.wait();
return 0;
}