Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Remove host run and dependencies from SYCL/FilterSelector tests #1208

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
34 changes: 1 addition & 33 deletions SYCL/FilterSelector/filter_list_cpu_gpu_acc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,71 +6,39 @@
//
//===---------------------------------------------------------------------===//

// REQUIRES: cpu, gpu, accelerator, host
// REQUIRES: cpu, gpu, accelerator

// RUN: %clangxx -fsycl %S/Inputs/filter_list_queries.cpp -o %t.out

// RUN: env SYCL_DEVICE_FILTER=acc %t.out | FileCheck %s --check-prefixes=CHECK-ACC-ONLY
// RUN: env SYCL_DEVICE_FILTER=gpu %t.out | FileCheck %s --check-prefixes=CHECK-GPU-ONLY
// RUN: env SYCL_DEVICE_FILTER=cpu %t.out | FileCheck %s --check-prefixes=CHECK-CPU-ONLY
// RUN: env SYCL_DEVICE_FILTER=host %t.out | FileCheck %s --check-prefixes=CHECK-HOST-ONLY
//
// RUN: env SYCL_DEVICE_FILTER=acc,gpu %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU
// RUN: env SYCL_DEVICE_FILTER=cpu,host %t.out | FileCheck %s --check-prefixes=CHECK-CPU-HOST
// RUN: env SYCL_DEVICE_FILTER=acc,cpu %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU
// RUN: env SYCL_DEVICE_FILTER=gpu,host %t.out | FileCheck %s --check-prefixes=CHECK-GPU-HOST
//
// RUN: env SYCL_DEVICE_FILTER=cpu,acc,host %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU-HOST
// RUN: env SYCL_DEVICE_FILTER=cpu,acc,gpu %t.out | FileCheck %s --check-prefixes=CHECK-ACC-GPU-CPU
// RUN: env CL_CONFIG_CPU_EMULATE_DEVICES=2 SYCL_DEVICE_FILTER=cpu,acc,host %t.out | FileCheck %s --check-prefixes=CHECK-ACC-CPU-HOST
// RUN: env SYCL_DEVICE_FILTER=cuda:cpu,opencl:gpu,level_zero:acc,host %t.out | FileCheck %s --check-prefixes=CHECK-GPU-HOST
//
// CHECK-ACC-ONLY: Device: acc
// CHECK-ACC-ONLY-NOT: Device: cpu
// CHECK-ACC-ONLY-NOT: Device: gpu
// CHECK-ACC-ONLY-NOT: Device: host
//
// CHECK-GPU-ONLY-NOT: Device: acc
// CHECK-GPU-ONLY: Device: gpu
// CHECK-GPU-ONLY-NOT: Device: cpu
// CHECK-GPU-ONLY-NOT: Device: host
//
// CHECK-CPU-ONLY-NOT: Device: acc
// CHECK-CPU-ONLY: Device: cpu
// CHECK-CPU-ONLY-NOT: Device: gpu
// CHECK-CPU-ONLY-NOT: Device: host
//
// CHECK-HOST-ONLY-NOT: Device: acc
// CHECK-HOST-ONLY-NOT: Device: gpu
// CHECK-HOST-ONLY-NOT: Device: cpu
// CHECK-HOST-ONLY: Device: host
//
// CHECK-ACC-GPU: Device: acc
// CHECK-ACC-GPU-NEXT: Device: gpu
// CHECK-ACC-GPU-NOT: Device: cpu
// CHECK-ACC-GPU-NOT: Device: host
//
// CHECK-CPU-HOST-NOT: Device: acc
// CHECK-CPU-HOST-NOT: Device: gpu
// CHECK-CPU-HOST: Device: cpu
// CHECK-CPU-HOST: Device: host
//
// CHECK-ACC-CPU: Device: acc
// CHECK-ACC-CPU-NEXT: Device: cpu
// CHECK-ACC-CPU-NOT: Device: gpu
// CHECK-ACC-CPU-NOT: Device: host
//
// CHECK-GPU-HOST-NOT: Device: acc
// CHECK-GPU-HOST: Device: gpu
// CHECK-GPU-HOST-NOT: Device: cpu
// CHECK-GPU-HOST: Device: host
//
// CHECK-ACC-CPU-HOST: Device: acc
// CHECK-ACC-CPU-HOST: Device: cpu
// CHECK-ACC-CPU-HOST-NOT: Device: gpu
// CHECK-ACC-CPU-HOST: Device: host
//
// CHECK-ACC-GPU-CPU: Device: acc
// CHECK-ACC-GPU-CPU-DAG: Device: gpu
// CHECK-ACC-GPU-CPU-DAG: Device: cpu
// CHECK-ACC-GPU-CPU-NOT: Device: host
1 change: 0 additions & 1 deletion SYCL/FilterSelector/reuse.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out
// RUN: %HOST_RUN_PLACEHOLDER %t1.out
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
// RUN: %ACC_RUN_PLACEHOLDER %t1.out
Expand Down
1 change: 0 additions & 1 deletion SYCL/FilterSelector/select.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out
// RUN: %HOST_RUN_PLACEHOLDER %t1.out
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
// RUN: %ACC_RUN_PLACEHOLDER %t1.out
Expand Down
10 changes: 2 additions & 8 deletions SYCL/FilterSelector/select_device.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: env SYCL_DEVICE_FILTER="*" %t.out
// RUN: env SYCL_DEVICE_FILTER=cpu,host %t.out
// RUN: env SYCL_DEVICE_FILTER=cpu %t.out
// RUN: env SYCL_DEVICE_FILTER=level_zero:gpu %t.out
// RUN: env SYCL_DEVICE_FILTER=opencl:gpu %t.out
// RUN: env SYCL_DEVICE_FILTER=cpu,level_zero:gpu %t.out
Expand All @@ -11,7 +11,7 @@
// Checks that no device is selected when no device of desired type is
// available.
//
// REQUIRES: cpu,gpu,accelerator,host
// REQUIRES: cpu,gpu,accelerator

#include <iostream>
#include <sycl/sycl.hpp>
Expand Down Expand Up @@ -50,12 +50,6 @@ int main() {
device d = cs.select_device();
std::cout << "CPU device is found: " << d.is_cpu() << std::endl;
}
if (!envVal || forcedPIs == "*" ||
forcedPIs.find("host") != std::string::npos) {
host_selector hs;
device d = hs.select_device();
std::cout << "HOST device is found: " << d.is_host() << std::endl;
}
if (!envVal || forcedPIs == "*" ||
forcedPIs.find("acc") != std::string::npos) {
accelerator_selector as;
Expand Down
14 changes: 0 additions & 14 deletions SYCL/FilterSelector/select_device_acc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,6 @@ int main() {
std::cout << "Expectedly, CPU device is not found." << std::endl;
}
}
/*
// TODO: enable this test after SYCL_DEVICE_FILTER is merged.
{
host_selector hs;
try {
device d = hs.select_device();
std::cerr << "HOST Device is found in error: " << std::boolalpha
<< d.is_cpu() << std::endl;
return -1;
} catch (...) {
std::cout << "Expectedly, HOST device is not found." << std::endl;
}
}
*/
{
accelerator_selector as;
device d = as.select_device();
Expand Down
13 changes: 0 additions & 13 deletions SYCL/FilterSelector/select_device_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,6 @@ int main() {
device d = cs.select_device();
std::cout << "CPU device is found: " << d.is_cpu() << std::endl;
}
/*
// TODO: enable this once SYCL_DEVICE_FILTER PR is merged.
{
host_selector hs;
try {
device d = hs.select_device();
std::cerr << "HOST device is found: " << d.is_host() << std::endl;
return -1;
} catch (...) {
std::cout << "Expectedly, HOST device is not found";
}
}
*/
{
accelerator_selector as;
try {
Expand Down
10 changes: 0 additions & 10 deletions SYCL/FilterSelector/select_device_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ int main() {
cout << "Expectedly, cpu device is not found." << std::endl;
}
}
{
host_selector hs;
try {
device d = hs.select_device();
cerr << "HOST device is found in error: " << d.is_host() << std::endl;
return -1;
} catch (...) {
cout << "Expectedly, HOST device is not found." << std::endl;
}
}
{
accelerator_selector as;
try {
Expand Down
10 changes: 2 additions & 8 deletions SYCL/FilterSelector/select_device_level_zero.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: env SYCL_DEVICE_FILTER=level_zero:gpu,host %t.out
// RUN: env SYCL_DEVICE_FILTER=level_zero:gpu %t.out
//
// Checks if only specified device types can be acquired from select_device
// when SYCL_DEVICE_FILTER is set
// Checks that no device is selected when no device of desired type is
// available.
//
// REQUIRES: level_zero,gpu,host
// REQUIRES: level_zero,gpu

#include <iostream>
#include <sycl/sycl.hpp>
Expand Down Expand Up @@ -47,12 +47,6 @@ int main() {
cout << "Expectedly, cpu device is not found." << std::endl;
}
}
// HOST device is always available regardless of SYCL_DEVICE_FILTER
{
host_selector hs;
device d = hs.select_device();
cout << "HOST device is found: " << d.is_host() << std::endl;
}
{
accelerator_selector as;
try {
Expand Down
7 changes: 1 addition & 6 deletions SYCL/FilterSelector/select_device_opencl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: env SYCL_DEVICE_FILTER=opencl,host %t.out
// RUN: env SYCL_DEVICE_FILTER=opencl %t.out
//
// Checks if only specified device types can be acquired from select_device
// when SYCL_DEVICE_FILTER is set
Expand Down Expand Up @@ -42,11 +42,6 @@ int main() {
device d = cs.select_device();
cout << "CPU device is found : " << d.is_cpu() << std::endl;
}
{
host_selector hs;
device d = hs.select_device();
cout << "HOST device is found: " << d.is_host() << std::endl;
}
{
accelerator_selector as;
device d = as.select_device();
Expand Down