Skip to content

[SYCL][PI][L0] Fixes dynamic batching unit test. #3270

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
Mar 1, 2021
Merged
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
15 changes: 8 additions & 7 deletions sycl/test/on-device/plugins/level_zero_dynamic_batch_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out

// Check that dynamic batching increases batch size
// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYNUP %s
// Check that dynamic batching raises/lowers batch size
// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYN %s

// level_zero_dynamic_batch_test.cpp
//
// This tests the level zero plugin's kernel dyanmic batch size adjustment
// This tests the level zero plugin's kernel dynamic batch size adjustment
// code.
// It starts out by enqueing 40 kernels before it does a wait, and it does
// this 5 times. That should cause the dynamic batch size adjustment to
// raise the batch size up several times.
// raise the batch size up 3 times.
//
// Then the test starts enqueueing only 4 kernels before doing a wait, and
// it does that 5 times as well. That should cause the batch size to
// be lowered, just once to be less than 4.
// it does that 20 times. That should cause the batch size to
// be lowered to be less than 4.
//
// CKDYN: Raising QueueBatchSize to 5
// CKDYN: Raising QueueBatchSize to 6
// CKDYN: Raising QueueBatchSize to 7
// CKDYN-NOT: Raising QueueBatchSize
// CKALL: Test Pass
// CKALL: Test Pass
Expand Down Expand Up @@ -165,7 +166,7 @@ int main(int argc, char *argv[]) {
validate(Y1, Z7, M * N);
validate(Y1, Z8, M * N);

for (size_t i = 0; i < 5; i++) {
for (size_t i = 0; i < 20; i++) {
q.submit([&](sycl::handler &h) {
h.parallel_for<class u32_copy9>(sycl::range<2>{M, N},
[=](sycl::id<2> it) {
Expand Down