diff --git a/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp b/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp index b48de4c405eff..31cf19446f973 100644 --- a/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp +++ b/sycl/test-e2e/Adapters/level_zero/batch_barrier.cpp @@ -1,6 +1,7 @@ // REQUIRES: gpu, level_zero, level_zero_dev_kit // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does not support regular cmd lists +// UNSUPPORTED-INTENDED: this test relies on L0v1 regular-command-list +// batching behavior. // UNSUPPORTED: windows && gpu-intel-gen12 // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21556 diff --git a/sycl/test-e2e/Adapters/level_zero/batch_event_status.cpp b/sycl/test-e2e/Adapters/level_zero/batch_event_status.cpp index af1b83daca6ef..a1c7d80970f54 100644 --- a/sycl/test-e2e/Adapters/level_zero/batch_event_status.cpp +++ b/sycl/test-e2e/Adapters/level_zero/batch_event_status.cpp @@ -5,7 +5,8 @@ // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21556 // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does not support regular cmd lists +// UNSUPPORTED-INTENDED: this test relies on L0v1 regular-command-list +// batching behavior. // UNSUPPORTED: ze_debug // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/22347 diff --git a/sycl/test-e2e/Adapters/level_zero/batch_test.cpp b/sycl/test-e2e/Adapters/level_zero/batch_test.cpp index bf0644c36939a..afbdfcc597cc5 100644 --- a/sycl/test-e2e/Adapters/level_zero/batch_test.cpp +++ b/sycl/test-e2e/Adapters/level_zero/batch_test.cpp @@ -5,8 +5,8 @@ // UNSUPPORTED: ze_debug // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/22347 // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: V1-only; V2 does not preserve zeCommandListClose/ -// zeCommandQueueExecuteCommandLists flush points. +// UNSUPPORTED-INTENDED: this test relies on L0v1 regular-command-list +// batching behavior. // UNSUPPORTED: windows && gpu-intel-gen12 // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21556 diff --git a/sycl/test-e2e/Adapters/level_zero/batch_test_copy_with_compute.cpp b/sycl/test-e2e/Adapters/level_zero/batch_test_copy_with_compute.cpp index d4c076046535a..5dc8cd5d1a96b 100644 --- a/sycl/test-e2e/Adapters/level_zero/batch_test_copy_with_compute.cpp +++ b/sycl/test-e2e/Adapters/level_zero/batch_test_copy_with_compute.cpp @@ -2,8 +2,8 @@ // UNSUPPORTED: ze_debug // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/22347 // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: V1-only; V2 does not preserve zeCommandListClose/ -// zeCommandQueueExecuteCommandLists flush points. +// UNSUPPORTED-INTENDED: this test relies on L0v1 regular-command-list +// batching behavior. // UNSUPPORTED: windows && (gpu-intel-gen12 || gpu-intel-dg2) // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21556 diff --git a/sycl/test-e2e/Adapters/level_zero/device_scope_events.cpp b/sycl/test-e2e/Adapters/level_zero/device_scope_events.cpp index e7d4950265cad..b31de3e961122 100644 --- a/sycl/test-e2e/Adapters/level_zero/device_scope_events.cpp +++ b/sycl/test-e2e/Adapters/level_zero/device_scope_events.cpp @@ -2,7 +2,7 @@ // UNSUPPORTED: ze_debug // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/22347 // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: V1-only +// UNSUPPORTED-INTENDED: UR_L0_DEVICE_SCOPE_EVENTS is V1-only. // UNSUPPORTED: windows && (gpu-intel-gen12 || gpu-intel-dg2) // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21766 diff --git a/sycl/test-e2e/Adapters/level_zero/eager_init.cpp b/sycl/test-e2e/Adapters/level_zero/eager_init.cpp index 72044e75ebb19..692c262837ba8 100644 --- a/sycl/test-e2e/Adapters/level_zero/eager_init.cpp +++ b/sycl/test-e2e/Adapters/level_zero/eager_init.cpp @@ -4,8 +4,8 @@ // function names that we match in the test. // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: Level Zero v2 adapter performs lazy initialization -// and does not support SYCL_EAGER_INIT=1, which this test requires. +// UNSUPPORTED-INTENDED: L0v2 does not consume SYCL_EAGER_INIT/UR_L0_EAGER_INIT; +// queue execution resources are initialized eagerly by design. // UNSUPPORTED: windows && gpu-intel-gen12 // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21556 diff --git a/sycl/test-e2e/Adapters/level_zero/events_caching.cpp b/sycl/test-e2e/Adapters/level_zero/events_caching.cpp index 55db76734730a..5c7c0508c2d8b 100644 --- a/sycl/test-e2e/Adapters/level_zero/events_caching.cpp +++ b/sycl/test-e2e/Adapters/level_zero/events_caching.cpp @@ -1,32 +1,44 @@ // REQUIRES: gpu, level_zero -// UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does not allow disabling caching // RUN: %{build} -o %t.out -// RUN: %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s -// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s -// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-DISABLED %s +// RUN: %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --check-prefixes=%if level_zero_v2_adapter %{CHECK-V2%} %else %{CACHING-ENABLED%} %s +// RUN: %if !level_zero_v2_adapter %{env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s%} +// RUN: %if !level_zero_v2_adapter %{env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 %{l0_leak_check} %{run} %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. +// +// L0v2 has no on/off switch for event caching, so check reuse directly. +// Handle reuse alone may result from driver address recycling. +// A low destroy count confirms resource reuse. // CACHING-ENABLED: zeEventCreate = {{[1-9]}} // CACHING-DISABLED: zeEventCreate = 256 +// CHECK-V2-DAG: Distinct native event handles: {{[1-9][0-9]?[[:space:]]*$}} +// CHECK-V2-DAG: zeEventDestroy = {{[1-9][0-9]?([[:space:]]|$)}} // Check event caching modes in the L0 adapter. +#include +#include #include +#include int main() { sycl::queue deviceQueue; + std::set distinctEvents; for (int i = 0; i < 256; i++) { auto Event = deviceQueue.submit([&](sycl::handler &cgh) { cgh.single_task([=]() {}); }); Event.wait(); + distinctEvents.insert( + sycl::get_native(Event)); } + std::cout << "Distinct native event handles: " << distinctEvents.size() + << "\n"; return 0; } diff --git a/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp b/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp index c4447ef4b1e78..a1cd59146e5fe 100644 --- a/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp +++ b/sycl/test-e2e/Adapters/level_zero/interop-direct.cpp @@ -1,13 +1,14 @@ // REQUIRES: level_zero, level_zero_dev_kit // UNSUPPORTED: ze_debug // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/22347 -// UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: V1-only behavior for -// UR_L0_USE_IMMEDIATE_COMMANDLISTS=0/1 // RUN: %{build} %level_zero_options -o %t.out -// RUN: env UR_L0_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out -// RUN: env UR_L0_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out +// RUN: %if !level_zero_v2_adapter %{env UR_L0_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out%} +// RUN: %if !level_zero_v2_adapter %{env UR_L0_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out%} +// +// L0v2 make_queue() supports wrapping an in-order immediate command list, +// but not a bare command queue. +// RUN: %if level_zero_v2_adapter %{%{build} %level_zero_options -DTEST_LEVEL_ZERO_V2_NATIVE_INTEROP -o %t_v2.out && %{run} %t_v2.out%} #include #include @@ -31,26 +32,14 @@ int main() { return 1; } - // Create Driver - uint32_t driver_handle_count = 0; - result = zeDriverGet(&driver_handle_count, nullptr); - if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeDriverGet failed\n"; - return 1; - } - std::cout << "Found " << driver_handle_count << " driver(s)\n"; - if (driver_handle_count == 0) - return 1; - - std::vector driver_handles(driver_handle_count); - result = zeDriverGet(&driver_handle_count, driver_handles.data()); - if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeDriverGet failed\n"; - return 1; - } - - ze_driver_handle_t ZeDriver = driver_handles[0]; - std::cout << "Using default driver, index 0\n"; + // Respects ONEAPI_DEVICE_SELECTOR, unlike raw zeDriverGet/zeDeviceGet. + device SyclSelectedDevice; + platform SyclSelectedPlatform = SyclSelectedDevice.get_platform(); + ze_driver_handle_t ZeDriver = + get_native(SyclSelectedPlatform); + ze_device_handle_t ZeDevice0 = + get_native(SyclSelectedDevice); + std::cout << "Using SYCL-selected driver and device\n"; // Everything below is created with ownership::keep, so this test owns the // Level Zero handles and must destroy them. Declared before the SYCL interop @@ -79,31 +68,19 @@ int main() { } ZeOwned.Context = ZeContext; - // Create Devices - uint32_t device_count = 0; - result = zeDeviceGet(ZeDriver, &device_count, nullptr); - if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeDeviceGet failed to get count of devices\n"; - return 1; - } - - std::vector ZeDevices(device_count); - result = zeDeviceGet(ZeDriver, &device_count, ZeDevices.data()); - if (result != ZE_RESULT_SUCCESS) { - std::cout << "zeDeviceGet failed to get device handles\n"; - return 1; - } - std::cout << "Using default device, index 0\n"; - // Create Command Queue ze_command_queue_desc_t Qdescriptor = {}; Qdescriptor.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC; Qdescriptor.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; Qdescriptor.ordinal = 0; Qdescriptor.index = 0; +#ifdef TEST_LEVEL_ZERO_V2_NATIVE_INTEROP + Qdescriptor.flags = ZE_COMMAND_QUEUE_FLAG_IN_ORDER; +#endif +#ifndef TEST_LEVEL_ZERO_V2_NATIVE_INTEROP ze_command_queue_handle_t ZeCommand_queue = nullptr; - result = zeCommandQueueCreate(ZeContext, ZeDevices[0], &Qdescriptor, + result = zeCommandQueueCreate(ZeContext, ZeDevice0, &Qdescriptor, &ZeCommand_queue); if (result != ZE_RESULT_SUCCESS) { std::cout << "zeCommandQueueCreate failed\n"; @@ -111,10 +88,11 @@ int main() { } ZeOwned.Queue = ZeCommand_queue; std::cout << "Commandqueue created: " << ZeCommand_queue << std::endl; +#endif // Create Command List ze_command_list_handle_t ZeCommand_list = nullptr; - result = zeCommandListCreateImmediate(ZeContext, ZeDevices[0], &Qdescriptor, + result = zeCommandListCreateImmediate(ZeContext, ZeDevice0, &Qdescriptor, &ZeCommand_list); if (result != ZE_RESULT_SUCCESS) { std::cout << "zeCommandListCreate failed\n"; @@ -125,7 +103,7 @@ int main() { // Interop object creation backend_traits::return_type ZeDevice; - ZeDevice = ZeDevices[0]; + ZeDevice = ZeDevice0; backend_input_t InteropPlatformInput{ZeDriver}; @@ -146,6 +124,7 @@ int main() { make_context(InteropContextInput); std::cout << "Made context\n"; +#ifndef TEST_LEVEL_ZERO_V2_NATIVE_INTEROP backend_input_t InteropQueueInputCQ{ ZeCommand_queue, InteropDevice, ext::oneapi::level_zero::ownership::keep}; queue InteropQueueCQ = make_queue( @@ -170,6 +149,7 @@ int main() { return 1; } } +#endif backend_input_t InteropQueueInputCL{ ZeCommand_list, InteropDevice, ext::oneapi::level_zero::ownership::keep}; @@ -195,6 +175,12 @@ int main() { return 1; } +#ifdef TEST_LEVEL_ZERO_V2_NATIVE_INTEROP + queue &InteropQueueForOps = InteropQueueCL; +#else + queue &InteropQueueForOps = InteropQueueCQ; +#endif + int dataSycl[3] = {7, 8, 0}; int dataCQ[3] = {7, 8, 0}; int dataCL[3] = {7, 8, 0}; @@ -225,9 +211,9 @@ int main() { std::cout << "GPU Result from SYCL Q = {" << hostOut[0] << ", " << hostOut[1] << ", " << hostOut[2] << "}" << std::endl; - // Try interop queue with standard commandlist - InteropQueueCQ.copy(addend, deviceData, 2).wait(); - InteropQueueCQ.submit([&](handler &cgh) { + // Try interop queue (command queue on v1, immediate command list on v2) + InteropQueueForOps.copy(addend, deviceData, 2).wait(); + InteropQueueForOps.submit([&](handler &cgh) { accessor numbers{bufDataCQ, cgh, read_write}; cgh.parallel_for(dataCount, [=](id<1> Id) { numbers[Id] += deviceData[0]; }); diff --git a/sycl/test-e2e/Adapters/level_zero/memory_fill.cpp b/sycl/test-e2e/Adapters/level_zero/memory_fill.cpp index 0dfe2460a516e..ee8d684f71d1f 100644 --- a/sycl/test-e2e/Adapters/level_zero/memory_fill.cpp +++ b/sycl/test-e2e/Adapters/level_zero/memory_fill.cpp @@ -1,6 +1,7 @@ // REQUIRES: gpu, level_zero, level_zero_dev_kit // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does not allow specifying command queue. +// UNSUPPORTED-INTENDED: the engine-selection control used by this test is +// V1-only. // UNSUPPORTED: windows && (gpu-intel-gen12 || gpu-intel-dg2) // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21556 diff --git a/sycl/test-e2e/Adapters/level_zero/queue_create.cpp b/sycl/test-e2e/Adapters/level_zero/queue_create.cpp index 141afdeec1218..c3594b660bd30 100644 --- a/sycl/test-e2e/Adapters/level_zero/queue_create.cpp +++ b/sycl/test-e2e/Adapters/level_zero/queue_create.cpp @@ -1,12 +1,20 @@ // REQUIRES: level_zero, level_zero_dev_kit -// UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does not support regular cmd lists // RUN: %{build} %level_zero_options -o %t.out -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=%if level_zero_v2_adapter %{CHECK-V2%} %else %{CHECK%} // +// The test checks that the Level Zero execution resources associated with a +// SYCL queue are created once and reused across all 1000 submissions, +// rather than being recreated per-submission, using the embedded +// UR_L0_LEAKS_DEBUG=1 testing capability. +// +// v1 creates a single regular command queue for the whole run: // CHECK: zeCommandQueueCreate = 1 \---> zeCommandQueueDestroy = 1 -// The test is to check that there is only a single level zero queue created -// with the embedded UR_L0_LEAKS_DEBUG=1 testing capability. +// +// L0v2 creates a queue's immediate command lists once, in its constructor (a +// pool of 4 today), so the count must not grow with the 1000 submissions; 1-16 +// leaves headroom. Every list that was created must be destroyed. +// CHECK-V2: zeCommandListCreateImmediate = [[N:[1-9]|1[0-6]]]{{([[:space:]]|$)}} +// CHECK-V2: zeCommandListCreate = 0 \---> zeCommandListDestroy = [[N]]{{([[:space:]]|$)}} // #include diff --git a/sycl/test-e2e/Adapters/level_zero/queue_priority.cpp b/sycl/test-e2e/Adapters/level_zero/queue_priority.cpp index 0419603d192d4..2f606896f6d5d 100644 --- a/sycl/test-e2e/Adapters/level_zero/queue_priority.cpp +++ b/sycl/test-e2e/Adapters/level_zero/queue_priority.cpp @@ -1,15 +1,20 @@ // REQUIRES: gpu, level_zero, level_zero_dev_kit -// UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does not support regular cmd lists // RUN: %{build} %level_zero_options -o %t.out -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-STD -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-IMM +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=%if level_zero_v2_adapter %{CHECK-V2%} %else %{CHECK-STD%} +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=%if level_zero_v2_adapter %{CHECK-V2%} %else %{CHECK-IMM%} // // Check that queue priority is passed to Level Zero runtime // This is the last value in the ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC // // With immediate command lists the command lists are recycled between queues in // a context. +// +// SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS is a v1-only selector between +// regular (CHECK-STD) and immediate (CHECK-IMM) command lists; v2 always uses +// immediate command lists and does not read this variable, so both RUN lines +// exercise the same v2 code path (CHECK-V2). The v2 checks cover only the +// public contract; how priorities map to Level Zero is covered by the adapter +// tests. #include #include #include @@ -45,6 +50,7 @@ int main(int Argc, const char *Argv[]) { // CHECK-STD: Queue cannot be constructed with different priorities. // CHECK-IMM: Queue cannot be constructed with different priorities. + // CHECK-V2: Queue cannot be constructed with different priorities. try { test(C, D, {sycl::ext::oneapi::property::queue::priority_low{}, @@ -53,6 +59,7 @@ int main(int Argc, const char *Argv[]) { std::cerr << E.what() << std::endl; } + // CHECK-V2: The test passed. std::cout << "The test passed." << std::endl; return 0; } diff --git a/sycl/test-e2e/Adapters/level_zero/usm_residency.cpp b/sycl/test-e2e/Adapters/level_zero/usm_residency.cpp index 10090142e0470..36ee23abcbe83 100644 --- a/sycl/test-e2e/Adapters/level_zero/usm_residency.cpp +++ b/sycl/test-e2e/Adapters/level_zero/usm_residency.cpp @@ -1,6 +1,7 @@ // REQUIRES: gpu, level_zero // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does not support changing residency. +// UNSUPPORTED-INTENDED: this test relies on the L0v1-specific +// SYCL_PI_LEVEL_ZERO_USM_RESIDENT configuration. // RUN: %{build} %level_zero_options -o %t.out // RUN: env SYCL_UR_TRACE=2 UR_L0_DEBUG=-1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck --check-prefixes=DEVICE %s diff --git a/sycl/test-e2e/Adapters/queue_submit_mode.cpp b/sycl/test-e2e/Adapters/queue_submit_mode.cpp index f6a66981a8dd3..b68f7d6460f7e 100644 --- a/sycl/test-e2e/Adapters/queue_submit_mode.cpp +++ b/sycl/test-e2e/Adapters/queue_submit_mode.cpp @@ -1,9 +1,7 @@ // REQUIRES: gpu, level_zero -// UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: v2 adapter does support regular cmd lists // RUN: %{build} %level_zero_options -o %t.out // RUN: env %{l0_leak_check} SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 0 2>&1 | FileCheck %s --check-prefixes=CHECK-STD -// RUN: env %{l0_leak_check} SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 1 2>&1 | FileCheck %s --check-prefixes=CHECK-IMM +// RUN: env %{l0_leak_check} SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 1 2>&1 | FileCheck %s --check-prefixes=%if level_zero_v2_adapter %{CHECK-IMM-V2%} %else %{CHECK-IMM%} // // UNSUPPORTED: target-native_cpu // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/20142 @@ -38,6 +36,8 @@ int main(int argc, char *argv[]) { // CHECK-STD: zeCommandListCreateImmediate = 1 // CHECK-IMM: zeCommandListCreateImmediate = 2 + // L0v2 out-of-order queues use a fixed pool of 4 immediate command lists. + // CHECK-IMM-V2: zeCommandListCreateImmediate = 4 queue Q1{P}; queue_submit(Q1); diff --git a/sycl/test-e2e/USM/usm_pooling.cpp b/sycl/test-e2e/USM/usm_pooling.cpp index 8c9582e3808ab..c207106a39bc7 100644 --- a/sycl/test-e2e/USM/usm_pooling.cpp +++ b/sycl/test-e2e/USM/usm_pooling.cpp @@ -2,8 +2,8 @@ // RUN: %{build} -o %t.out // UNSUPPORTED: level_zero_v2_adapter -// UNSUPPORTED-INTENDED: memory allocation logs are not emitted in -// level_zero_v2_adapter +// UNSUPPORTED-INTENDED: this test checks a residency call sequence that L0v2 +// does not reproduce. // UNSUPPORTED: windows // UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/21556 @@ -11,29 +11,29 @@ // Allocate 2 items of 2MB. Free 2. Allocate 3 more of 2MB. // With no pooling: 1,2,3,4,5 allocs lead to ZE call. -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_DISABLE_USM_ALLOCATOR=1 %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_DISABLE_USM_ALLOCATOR=1 %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_DISABLE_USM_ALLOCATOR=1 %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL // With pooling enabled and MaxPooolable=1MB: 1,2,3,4,5 allocs lead to ZE call. -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-12345 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-12345 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-12345 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-12345 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-12345 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-12345 // With pooling enabled and capacity=1: 1,2,4,5 allocs lead to ZE call. -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 // With pooling enabled and MaxPoolSize=2MB: 1,2,4,5 allocs lead to ZE call. -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 // With pooling enabled and SlabMinSize of 4 MB: 1,5 allocs lead to ZE call. -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-15 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-15 -// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-15 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-15 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-15 +// RUN: env UR_L0_DEBUG=1 UR_L0_USM_RESIDENT=0 UR_L0_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-15 #include "sycl/detail/core.hpp"