diff --git a/SYCL/Basic/subdevice_pi.cpp b/SYCL/Basic/subdevice_pi.cpp index 5544d06170..a25f147a56 100644 --- a/SYCL/Basic/subdevice_pi.cpp +++ b/SYCL/Basic/subdevice_pi.cpp @@ -59,7 +59,7 @@ static bool check_separate(device dev, buffer buf, } // CHECK-SEPARATE: Test sub device 0 // CHECK-SEPARATE: ---> piContextCreate - // CHECK-SEPARATE: ---> piQueueCreate + // CHECK-SEPARATE: ---> piextQueueCreate // CHECK-SEPARATE: ---> piMemBufferCreate // CHECK-SEPARATE: ---> piEnqueueKernelLaunch // CHECK-SEPARATE: ---> piQueueFinish @@ -71,7 +71,7 @@ static bool check_separate(device dev, buffer buf, } // CHECK-SEPARATE: Test sub device 1 // CHECK-SEPARATE: ---> piContextCreate - // CHECK-SEPARATE: ---> piQueueCreate + // CHECK-SEPARATE: ---> piextQueueCreate // CHECK-SEPARATE: ---> piMemBufferCreate // // Verify that we have a memcpy between subdevices in this case @@ -107,7 +107,7 @@ static bool check_shared_context(device dev, buffer buf, use_mem(buf, q0); } // CHECK-SHARED: Test sub device 0 - // CHECK-SHARED: ---> piQueueCreate + // CHECK-SHARED: ---> piextQueueCreate // CHECK-SHARED: ---> piMemBufferCreate // // Make sure that a single buffer is created (and shared between subdevices): @@ -122,7 +122,7 @@ static bool check_shared_context(device dev, buffer buf, use_mem(buf, q1); } // CHECK-SHARED: Test sub device 1 - // CHECK-SHARED: ---> piQueueCreate + // CHECK-SHARED: ---> piextQueueCreate // CHECK-SHARED: ---> piEnqueueKernelLaunch // CHECK-SHARED: ---> piQueueFinish // CHECK-SHARED: ---> piEnqueueMemBufferRead @@ -156,7 +156,7 @@ static bool check_fused_context(device dev, buffer buf, use_mem(buf, q); } // CHECK-FUSED: Test root device - // CHECK-FUSED: ---> piQueueCreate + // CHECK-FUSED: ---> piextQueueCreate // CHECK-FUSED: ---> piMemBufferCreate // // Make sure that a single buffer is created (and shared between subdevices @@ -171,7 +171,7 @@ static bool check_fused_context(device dev, buffer buf, use_mem(buf, q0); } // CHECK-FUSED: Test sub device 0 - // CHECK-FUSED: ---> piQueueCreate + // CHECK-FUSED: ---> piextQueueCreate // CHECK-FUSED: ---> piEnqueueKernelLaunch // CHECK-FUSED: ---> piQueueFinish @@ -181,7 +181,7 @@ static bool check_fused_context(device dev, buffer buf, use_mem(buf, q1); } // CHECK-FUSED: Test sub device 1 - // CHECK-FUSED: ---> piQueueCreate + // CHECK-FUSED: ---> piextQueueCreate // CHECK-FUSED: ---> piEnqueueKernelLaunch // CHECK-FUSED: ---> piQueueFinish // CHECK-FUSED: ---> piEnqueueMemBufferRead diff --git a/SYCL/Plugin/level_zero_ext_intel_queue_index.cpp b/SYCL/Plugin/level_zero_ext_intel_queue_index.cpp new file mode 100644 index 0000000000..33347bbee7 --- /dev/null +++ b/SYCL/Plugin/level_zero_ext_intel_queue_index.cpp @@ -0,0 +1,107 @@ +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out +// RUN: env ZEX_NUMBER_OF_CCS=0:4 env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out > %t.log 2>&1 +// RUN: %GPU_RUN_PLACEHOLDER FileCheck %s --check-prefixes=CHECK-PVC < %t.log +// +// Same with Immediate CommandLists +// RUN: env SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 env ZEX_NUMBER_OF_CCS=0:4 env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out > %t.log 2>&1 +// RUN: %GPU_RUN_PLACEHOLDER FileCheck %s --check-prefixes=CHECK-PVC < %t.log + +// Requires: level_zero + +#include + +using namespace sycl; + +void test_pvc(device &d) { + std::cout << "Test PVC Begin" << std::endl; + // CHECK-PVC: Test PVC Begin + bool IsPVC = [&]() { + if (!d.has(aspect::ext_intel_device_id)) + return false; + return (d.get_info() & 0xff0) == 0xbd0; + }(); + std::cout << "IsPVC: " << std::boolalpha << IsPVC << std::endl; + if (IsPVC) { + assert(d.get_info() == + 1); + + auto sub_devices = d.create_sub_devices< + info::partition_property::partition_by_affinity_domain>( + info::partition_affinity_domain::next_partitionable); + device &sub_device = sub_devices[1]; + assert( + sub_device + .get_info() == + 4); + + auto sub_sub_devices = sub_device.create_sub_devices< + info::partition_property::ext_intel_partition_by_cslice>(); + device &sub_sub_device = sub_sub_devices[1]; + assert( + sub_sub_device + .get_info() == + 1); + + { + bool ExceptionThrown = false; + try { + std::ignore = queue{d, ext::intel::property::queue::compute_index{-1}}; + + } catch (...) { + ExceptionThrown = true; + } + assert(ExceptionThrown); + } + { + bool ExceptionThrown = false; + try { + std::ignore = queue{sub_sub_device, + ext::intel::property::queue::compute_index{1}}; + + } catch (...) { + ExceptionThrown = true; + } + assert(ExceptionThrown); + } + + { + queue q{sub_device}; + // CHECK-PVC: [getZeQueue]: create queue ordinal = 0, index = 0 (round robin in [0, 0]) + q.single_task([=]() {}).wait(); + } + { + queue q{sub_device, ext::intel::property::queue::compute_index{2}}; + // CHECK-PVC: [getZeQueue]: create queue ordinal = 0, index = 2 (round robin in [2, 2]) + q.single_task([=]() {}).wait(); + } + { + queue q{sub_device, ext::intel::property::queue::compute_index{2}}; + // CHECK-PVC: [getZeQueue]: create queue ordinal = 0, index = 2 (round robin in [2, 2]) + q.single_task([=]() {}).wait(); + } + { + queue q{sub_sub_device}; + // CHECK-PVC: [getZeQueue]: create queue ordinal = 0, index = 1 (round robin in [1, 1]) + q.single_task([=]() {}).wait(); + } + } else { + // Make FileCheck pass. + std::cout << "Fake ZE_DEBUG output for FileCheck:" << std::endl; + // clang-format off + std::cout << "[getZeQueue]: create queue ordinal = 0, index = 0 (round robin in [0, 0])" << std::endl; + std::cout << "[getZeQueue]: create queue ordinal = 0, index = 2 (round robin in [2, 2])" << std::endl; + std::cout << "[getZeQueue]: create queue ordinal = 0, index = 2 (round robin in [2, 2])" << std::endl; + std::cout << "[getZeQueue]: create queue ordinal = 0, index = 1 (round robin in [1, 1])" << std::endl; + // clang-format on + } + std::cout << "Test PVC End" << std::endl; + // CHECK-PVC: Test PVC End +} + +int main() { + device d; + + test_pvc(d); + + return 0; +} diff --git a/SYCL/Scheduler/ReleaseResourcesTest.cpp b/SYCL/Scheduler/ReleaseResourcesTest.cpp index acc446762e..0f4bb4de46 100644 --- a/SYCL/Scheduler/ReleaseResourcesTest.cpp +++ b/SYCL/Scheduler/ReleaseResourcesTest.cpp @@ -48,7 +48,7 @@ int main() { } // CHECK:---> piContextCreate -// CHECK:---> piQueueCreate +// CHECK:---> piextQueueCreate // CHECK:---> piProgramCreate // CHECK:---> piKernelCreate // CHECK:---> piQueueRelease