From c34a21c5d0181c91c5ae9173e177862a6d8d359e Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Fri, 2 Sep 2022 04:20:43 -0700 Subject: [PATCH 1/2] [SYCL] Remove host run and dependencies from SYCL/Regression tests This commit removes the host run and any assumptions and operations related to the host device from the tests in SYCL/Regression. Co-authored-by: Sachkov, Alexey Signed-off-by: Larsen, Steffen --- SYCL/Regression/atomic_load.cpp | 1 - SYCL/Regression/cache_test.cpp | 4 ++-- SYCL/Regression/complex_global_object.cpp | 1 - SYCL/Regression/device_num.cpp | 17 +---------------- SYCL/Regression/event_destruction.cpp | 1 - SYCL/Regression/fp16-with-unnamed-lambda.cpp | 1 - SYCL/Regression/get_subgroup_sizes.cpp | 1 - SYCL/Regression/global_queue.cpp | 1 - SYCL/Regression/group.cpp | 1 - SYCL/Regression/image_access.cpp | 1 - SYCL/Regression/implicit_atomic_conversion.cpp | 1 - SYCL/Regression/kernel_name_class.cpp | 2 -- SYCL/Regression/kernel_unnamed.cpp | 1 - SYCL/Regression/local-arg-align.cpp | 1 - SYCL/Regression/msvc_crt.cpp | 2 -- .../nontrivial_device_copyable_value.cpp | 1 - SYCL/Regression/private_array_init_test.cpp | 1 - SYCL/Regression/same_unnamed_kernels.cpp | 1 - SYCL/Regression/static-buffer-dtor.cpp | 1 - SYCL/Regression/unoptimized_stream.cpp | 1 - SYCL/Regression/usm_malloc_shared.cpp | 1 - SYCL/Regression/zero_size_local_accessor.cpp | 1 - 22 files changed, 3 insertions(+), 40 deletions(-) diff --git a/SYCL/Regression/atomic_load.cpp b/SYCL/Regression/atomic_load.cpp index 722384945e..4416a9b74f 100644 --- a/SYCL/Regression/atomic_load.cpp +++ b/SYCL/Regression/atomic_load.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/cache_test.cpp b/SYCL/Regression/cache_test.cpp index 393d6ab63a..a485539bf2 100644 --- a/SYCL/Regression/cache_test.cpp +++ b/SYCL/Regression/cache_test.cpp @@ -134,8 +134,8 @@ int main() { std::vector device_list; for (const auto &plt : sycl::platform::get_platforms()) { std::cout << "Platform " << pindex++ << " " - << ((plt.is_host()) ? "host" : "") << " (" - << plt.get_info() << ")" << std::endl; + << " (" << plt.get_info() << ")" + << std::endl; platform_list.push_back(plt); int dindex = 1; diff --git a/SYCL/Regression/complex_global_object.cpp b/SYCL/Regression/complex_global_object.cpp index 383e58b50d..9d35d18fd3 100644 --- a/SYCL/Regression/complex_global_object.cpp +++ b/SYCL/Regression/complex_global_object.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/device_num.cpp b/SYCL/Regression/device_num.cpp index 2cc51a598b..80b990bff2 100644 --- a/SYCL/Regression/device_num.cpp +++ b/SYCL/Regression/device_num.cpp @@ -19,12 +19,10 @@ using namespace std; const std::map DeviceTypeStringMap = { {info::device_type::cpu, "cpu"}, {info::device_type::gpu, "gpu"}, - {info::device_type::host, "host"}, {info::device_type::accelerator, "acc"}}; const std::map BackendStringMap = { {backend::opencl, "opencl"}, - {backend::host, "host"}, {backend::ext_oneapi_level_zero, "ext_oneapi_level_zero"}, {backend::ext_intel_esimd_emulator, "ext_intel_esimd_emulator"}, {backend::ext_oneapi_cuda, "ext_oneapi_cuda"}, @@ -108,12 +106,10 @@ int GetPreferredDeviceIndex(const std::vector &devices, // gpu L0, opencl // cpu // acc - // host const std::map scoreByType = { {info::device_type::cpu, 300}, {info::device_type::gpu, 500}, - {info::device_type::accelerator, 75}, - {info::device_type::host, 100}}; + {info::device_type::accelerator, 75}}; int score = -1; int index = -1; int devCount = devices.size(); @@ -213,17 +209,6 @@ int main() { assert(devices[targetDevIndex] == d && "The selected device is not the target device specified."); } - targetDevIndex = GetPreferredDeviceIndex(devices, info::device_type::host); - assert((targetDevIndex >= 0 || deviceNum != 0) && - "Failed to find host device."); - if (targetDevIndex >= 0) { - host_selector hs; - device d = hs.select_device(); - std::cout << "host_selector selected "; - printDeviceType(d); - assert(devices[targetDevIndex] == d && - "The selected device is not a host device."); - } return 0; } diff --git a/SYCL/Regression/event_destruction.cpp b/SYCL/Regression/event_destruction.cpp index 071f4d7d79..a3d35b4217 100644 --- a/SYCL/Regression/event_destruction.cpp +++ b/SYCL/Regression/event_destruction.cpp @@ -2,7 +2,6 @@ // Temporarily disabled because the test is out of time // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/fp16-with-unnamed-lambda.cpp b/SYCL/Regression/fp16-with-unnamed-lambda.cpp index 87504c1077..249f337ed6 100644 --- a/SYCL/Regression/fp16-with-unnamed-lambda.cpp +++ b/SYCL/Regression/fp16-with-unnamed-lambda.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-unnamed-lambda %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/get_subgroup_sizes.cpp b/SYCL/Regression/get_subgroup_sizes.cpp index 6a0c0b3b0d..65d2938716 100644 --- a/SYCL/Regression/get_subgroup_sizes.cpp +++ b/SYCL/Regression/get_subgroup_sizes.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/global_queue.cpp b/SYCL/Regression/global_queue.cpp index 07429ebe07..707866d904 100644 --- a/SYCL/Regression/global_queue.cpp +++ b/SYCL/Regression/global_queue.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/group.cpp b/SYCL/Regression/group.cpp index d0be836278..15a99602d6 100644 --- a/SYCL/Regression/group.cpp +++ b/SYCL/Regression/group.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/image_access.cpp b/SYCL/Regression/image_access.cpp index 1a6d399e62..ace06d20e3 100644 --- a/SYCL/Regression/image_access.cpp +++ b/SYCL/Regression/image_access.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER // RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER // No execution of FPGA because it does not support images diff --git a/SYCL/Regression/implicit_atomic_conversion.cpp b/SYCL/Regression/implicit_atomic_conversion.cpp index 27e2d737e2..f2dbf60944 100644 --- a/SYCL/Regression/implicit_atomic_conversion.cpp +++ b/SYCL/Regression/implicit_atomic_conversion.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/kernel_name_class.cpp b/SYCL/Regression/kernel_name_class.cpp index 9930d75c40..348df90975 100644 --- a/SYCL/Regression/kernel_name_class.cpp +++ b/SYCL/Regression/kernel_name_class.cpp @@ -1,10 +1,8 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.ext.out -fsycl-unnamed-lambda -// RUN: %HOST_RUN_PLACEHOLDER %t.ext.out // RUN: %CPU_RUN_PLACEHOLDER %t.ext.out // RUN: %GPU_RUN_PLACEHOLDER %t.ext.out // RUN: %ACC_RUN_PLACEHOLDER %t.ext.out diff --git a/SYCL/Regression/kernel_unnamed.cpp b/SYCL/Regression/kernel_unnamed.cpp index 2e037a8750..78534ce680 100644 --- a/SYCL/Regression/kernel_unnamed.cpp +++ b/SYCL/Regression/kernel_unnamed.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -fsycl-unnamed-lambda -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/local-arg-align.cpp b/SYCL/Regression/local-arg-align.cpp index 69f07b908a..f064a73c3b 100644 --- a/SYCL/Regression/local-arg-align.cpp +++ b/SYCL/Regression/local-arg-align.cpp @@ -1,6 +1,5 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/msvc_crt.cpp b/SYCL/Regression/msvc_crt.cpp index 1b2fed0a2d..71b6e1decb 100644 --- a/SYCL/Regression/msvc_crt.cpp +++ b/SYCL/Regression/msvc_crt.cpp @@ -1,10 +1,8 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple /MD -o %t1.exe %s -// RUN: %HOST_RUN_PLACEHOLDER %t1.exe // RUN: %CPU_RUN_PLACEHOLDER %t1.exe // RUN: %GPU_RUN_PLACEHOLDER %t1.exe // RUN: %ACC_RUN_PLACEHOLDER %t1.exe // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple /MDd -o %t2.exe %s -// RUN: %HOST_RUN_PLACEHOLDER %t2.exe // RUN: %CPU_RUN_PLACEHOLDER %t2.exe // RUN: %GPU_RUN_PLACEHOLDER %t2.exe // RUN: %ACC_RUN_PLACEHOLDER %t2.exe diff --git a/SYCL/Regression/nontrivial_device_copyable_value.cpp b/SYCL/Regression/nontrivial_device_copyable_value.cpp index 330361fc9a..f6cad5fbf6 100644 --- a/SYCL/Regression/nontrivial_device_copyable_value.cpp +++ b/SYCL/Regression/nontrivial_device_copyable_value.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/private_array_init_test.cpp b/SYCL/Regression/private_array_init_test.cpp index 1f1ccb66bf..12bd9fa339 100644 --- a/SYCL/Regression/private_array_init_test.cpp +++ b/SYCL/Regression/private_array_init_test.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/same_unnamed_kernels.cpp b/SYCL/Regression/same_unnamed_kernels.cpp index f008690269..f570d772b9 100644 --- a/SYCL/Regression/same_unnamed_kernels.cpp +++ b/SYCL/Regression/same_unnamed_kernels.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl %s -o %t.out -fsycl-unnamed-lambda -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/static-buffer-dtor.cpp b/SYCL/Regression/static-buffer-dtor.cpp index cc4d15196d..04edb27516 100644 --- a/SYCL/Regression/static-buffer-dtor.cpp +++ b/SYCL/Regression/static-buffer-dtor.cpp @@ -10,7 +10,6 @@ // would start shutting down. //===----------------------------------------------------------------------===// // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/unoptimized_stream.cpp b/SYCL/Regression/unoptimized_stream.cpp index 9edfb3c39f..83d3d71f19 100644 --- a/SYCL/Regression/unoptimized_stream.cpp +++ b/SYCL/Regression/unoptimized_stream.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -O0 -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Regression/usm_malloc_shared.cpp b/SYCL/Regression/usm_malloc_shared.cpp index 6a8463a924..824080dedd 100644 --- a/SYCL/Regression/usm_malloc_shared.cpp +++ b/SYCL/Regression/usm_malloc_shared.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // This test checks if users will successfully allocate 160, 0, and -16 bytes of diff --git a/SYCL/Regression/zero_size_local_accessor.cpp b/SYCL/Regression/zero_size_local_accessor.cpp index 587644e368..6298d8b6db 100644 --- a/SYCL/Regression/zero_size_local_accessor.cpp +++ b/SYCL/Regression/zero_size_local_accessor.cpp @@ -1,5 +1,4 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out From 933c5b42a3100def719c85918fcdb14ed8e1e350 Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Mon, 5 Sep 2022 04:18:26 -0700 Subject: [PATCH 2/2] Reintroduce host to the map. Can be removed after host device removal. Signed-off-by: Larsen, Steffen --- SYCL/Regression/device_num.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SYCL/Regression/device_num.cpp b/SYCL/Regression/device_num.cpp index 80b990bff2..844cfa5382 100644 --- a/SYCL/Regression/device_num.cpp +++ b/SYCL/Regression/device_num.cpp @@ -19,10 +19,12 @@ using namespace std; const std::map DeviceTypeStringMap = { {info::device_type::cpu, "cpu"}, {info::device_type::gpu, "gpu"}, + {info::device_type::host, "host"}, {info::device_type::accelerator, "acc"}}; const std::map BackendStringMap = { {backend::opencl, "opencl"}, + {backend::host, "host"}, {backend::ext_oneapi_level_zero, "ext_oneapi_level_zero"}, {backend::ext_intel_esimd_emulator, "ext_intel_esimd_emulator"}, {backend::ext_oneapi_cuda, "ext_oneapi_cuda"}, @@ -109,7 +111,8 @@ int GetPreferredDeviceIndex(const std::vector &devices, const std::map scoreByType = { {info::device_type::cpu, 300}, {info::device_type::gpu, 500}, - {info::device_type::accelerator, 75}}; + {info::device_type::accelerator, 75}, + {info::device_type::host, 100}}; int score = -1; int index = -1; int devCount = devices.size();