From 39f2bb802bc98bfec452b9cc02d036ea125cc879 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 12 Dec 2024 02:24:49 -0800 Subject: [PATCH] [SYCL][E2E][Subdevice] Reduce run time of test subdevice_pi.cpp On intel cpu device, the number of subdevices was the same as cpu count. The number could be large on a server. In `shared` subtest, all subdevices belong to the same context and device program is built for every subdevice. Device code compilation may take long time. This PR reduces test time from 10s to 0.4s on 160-core ICX. When device sanitizer is enabled, test time is reduced from ~10min to 14s. --- sycl/test-e2e/Basic/subdevice_pi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/subdevice_pi.cpp b/sycl/test-e2e/Basic/subdevice_pi.cpp index b41c9a21dc055..4a0e4a06e016d 100644 --- a/sycl/test-e2e/Basic/subdevice_pi.cpp +++ b/sycl/test-e2e/Basic/subdevice_pi.cpp @@ -39,8 +39,10 @@ static std::vector partition_affinity(device dev) { } static std::vector partition_equally(device dev) { + auto maxUnits = dev.get_info(); std::vector subdevices = - dev.create_sub_devices(1); + dev.create_sub_devices( + maxUnits / 2); return subdevices; }