Skip to content

[SYCL][E2E] Update some incompatible requirements #18007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sycl/test-e2e/AOT/multiple-devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: opencl-aot, ocloc, cpu, gpu, target-spir, opencl-cpu-rt
// REQUIRES: opencl-aot, ocloc, any-device-is-cpu, any-device-is-gpu, target-spir, opencl-cpu-rt

// Produce a fat object for all targets (generic SPIR-V, CPU, GPU)
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_gen %S/Inputs/aot.cpp -c -o %t.o

// CPU, GPU
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_cpu_gpu.out
// RUN: %if gpu || cpu %{ %{run} %t_cpu_gpu.out %}
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_cpu_gpu.out
// RUN: %{run} %t_cpu_gpu.out

// No AOT-compiled image for CPU
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_spv_gpu.out
// Check that execution on AOT-compatible devices is unaffected
// RUN: %{run} %t_spv_gpu.out
// RUN: env ONEAPI_DEVICE_SELECTOR="*:gpu" %{run-unfiltered-devices} %t_spv_gpu.out

// No AOT-compiled image for GPU
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64 %t.o -o %t_spv_cpu.out
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64 %t.o -o %t_spv_cpu.out
// Check that execution on AOT-compatible devices is unaffected
// RUN: %{run} %t_spv_cpu.out
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %{run-unfiltered-devices} %t_spv_cpu.out

// No AOT-compiled image for FPGA
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_spv_cpu_gpu.out
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_spv_cpu_gpu.out
// Check that execution on AOT-compatible devices is unaffected
// RUN: %{run} %t_spv_cpu_gpu.out
25 changes: 25 additions & 0 deletions sycl/test-e2e/FilterSelector/filter_list_cpu_gpu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//==------------------ filter_list_cpu_gpu_acc.cpp ------------------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------------------------------------------------===//

// REQUIRES: any-device-is-cpu, any-device-is-gpu

// RUN: %{build} %S/Inputs/filter_list_queries.cpp -o %t.out

// RUN: env ONEAPI_DEVICE_SELECTOR="*:gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-GPU-ONLY
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-CPU-ONLY
//
// RUN: env ONEAPI_DEVICE_SELECTOR="*:cpu,gpu" %{run-unfiltered-devices} %t.out | FileCheck %s --check-prefixes=CHECK-GPU-CPU
//
// CHECK-GPU-ONLY: Device: gpu
// CHECK-GPU-ONLY-NOT: Device: cpu
//
// CHECK-CPU-ONLY: Device: cpu
// CHECK-CPU-ONLY-NOT: Device: gpu
//
// CHECK-GPU-CPU-DAG: Device: gpu
// CHECK-GPU-CPU-DAG: Device: cpu
44 changes: 0 additions & 44 deletions sycl/test-e2e/FilterSelector/filter_list_cpu_gpu_acc.cpp

This file was deleted.

11 changes: 3 additions & 8 deletions sycl/test-e2e/FilterSelector/select_device_opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Checks that no device is selected when no device of desired type is
// available.
//
// REQUIRES: opencl,gpu,cpu,accelerator
// REQUIRES: opencl, any-device-is-gpu, any-device-is-cpu

#include "../helpers.hpp"
#include <iostream>
Expand All @@ -16,12 +16,6 @@ using namespace sycl;
using namespace std;

int main() {
std::string envVal = env::getVal("ONEAPI_DEVICE_SELECTOR");
string forcedPIs;
if (envVal.empty()) {
forcedPIs = envVal;
}

{
device d(default_selector_v);
string name = d.get_platform().get_info<info::platform::name>();
Expand All @@ -38,7 +32,8 @@ int main() {
device d(cpu_selector_v);
}
{
device d(accelerator_selector_v);
// We no longer run tests on acc. Leaving this just in case.
// device d(accelerator_selector_v);
}

return 0;
Expand Down
39 changes: 39 additions & 0 deletions sycl/test-e2e/OneapiDeviceSelector/cpu_gpu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// REQUIRES: any-device-is-cpu, any-device-is-gpu, opencl

// RUN: %{build} -o %t.out

// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR=opencl:gpu %t.out | FileCheck %s --check-prefixes=CHECK-GPU-ONLY
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR=opencl:cpu %t.out | FileCheck %s --check-prefixes=CHECK-CPU-ONLY

// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR=opencl:cpu,gpu %t.out | FileCheck %s --check-prefixes=CHECK-GPU-CPU
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="opencl:*" %t.out | FileCheck %s --check-prefixes=CHECK-GPU-CPU

// CHECK-GPU-ONLY-NOT: Device: cpu
// CHECK-GPU-ONLY: Device: gpu

// CHECK-CPU-ONLY-NOT: Device: gpu
// CHECK-CPU-ONLY: Device: cpu

// CHECK-GPU-CPU-DAG: Device: gpu
// CHECK-GPU-CPU-DAG: Device: cpu

#include <iostream>
#include <map>
#include <sycl/detail/core.hpp>

using namespace sycl;

int main() {

std::map<info::device_type, std::string> m = {
{info::device_type::cpu, "cpu"},
{info::device_type::gpu, "gpu"},
{info::device_type::all, "all"}};

for (auto &d : device::get_devices()) {
std::cout << "Device: " << m[d.get_info<info::device::device_type>()]
<< std::endl;
}

return 0;
}
65 changes: 0 additions & 65 deletions sycl/test-e2e/OneapiDeviceSelector/cpu_gpu_acc.cpp

This file was deleted.

6 changes: 3 additions & 3 deletions sycl/test-e2e/USM/multictxt.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %{build} -o %t1.out
// RUN: %{run-unfiltered-devices} %t1.out
// RUN: %{build} -o %t.out
// RUN: %{run-unfiltered-devices} %t.out

// REQUIRES: cpu, gpu
// REQUIRES: any-device-is-cpu, any-device-is-gpu

//==----------------- multictxt.cpp - Multi Context USM test ---------------==//
//
Expand Down