From 3901c22ab32c1b611cb8385059d8d1da83622463 Mon Sep 17 00:00:00 2001 From: Artur Gainullin Date: Mon, 8 Aug 2022 14:58:57 -0700 Subject: [PATCH 1/2] [SYCL] Fix events caching test It looks like some resources can be released asynchronously in the scheduler. That's why at some runs 1 event is enough but sometimes 2 events are needed. So use regular expression to allow up to 9 events just in case. --- SYCL/Plugin/level_zero_events_caching.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SYCL/Plugin/level_zero_events_caching.cpp b/SYCL/Plugin/level_zero_events_caching.cpp index 902c6723f9..26c3479599 100644 --- a/SYCL/Plugin/level_zero_events_caching.cpp +++ b/SYCL/Plugin/level_zero_events_caching.cpp @@ -7,7 +7,7 @@ // RUN: env SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=0 ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s // RUN: env SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=0 SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=CACHING-DISABLED %s -// CACHING-ENABLED: zeEventCreate = 1 +// CACHING-ENABLED: zeEventCreate = {{[1-9]}} // CACHING-DISABLED: zeEventCreate = 256 // Check event caching modes in the L0 plugin. From 8694aa34e1e433adec4e7eb87ec2070f5f8e96fe Mon Sep 17 00:00:00 2001 From: Artur Gainullin Date: Fri, 9 Sep 2022 12:56:59 -0700 Subject: [PATCH 2/2] Add a comment --- SYCL/Plugin/level_zero_events_caching.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SYCL/Plugin/level_zero_events_caching.cpp b/SYCL/Plugin/level_zero_events_caching.cpp index 26c3479599..a66ca4c8e0 100644 --- a/SYCL/Plugin/level_zero_events_caching.cpp +++ b/SYCL/Plugin/level_zero_events_caching.cpp @@ -7,6 +7,10 @@ // RUN: env SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=0 ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s // RUN: env SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=0 SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=CACHING-DISABLED %s +// With events caching we should be reusing them and 9 should be enough. +// Might require more than one if previous one hasn't been released by the time +// we need a new one. + // CACHING-ENABLED: zeEventCreate = {{[1-9]}} // CACHING-DISABLED: zeEventCreate = 256