diff --git a/SYCL/Basic/default_device.cpp b/SYCL/Basic/default_device.cpp new file mode 100644 index 0000000000..cb13268d18 --- /dev/null +++ b/SYCL/Basic/default_device.cpp @@ -0,0 +1,21 @@ +//==--------- default_device.cpp - SYCL device default ctor test -----------==// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// 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 + +#include + +int main() { + sycl::device Dev; + assert(Dev == sycl::device{sycl::default_selector_v}); + return 0; +} diff --git a/SYCL/Basic/default_platform.cpp b/SYCL/Basic/default_platform.cpp new file mode 100644 index 0000000000..89c6606581 --- /dev/null +++ b/SYCL/Basic/default_platform.cpp @@ -0,0 +1,21 @@ +//==------- default_platform.cpp - SYCL platform default ctor test ---------==// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// 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 + +#include + +int main() { + sycl::platform Plt; + assert(Plt == sycl::platform{sycl::default_selector_v}); + return 0; +} diff --git a/SYCL/Basic/device_equality.cpp b/SYCL/Basic/device_equality.cpp index 556cf84a3e..20295a393f 100644 --- a/SYCL/Basic/device_equality.cpp +++ b/SYCL/Basic/device_equality.cpp @@ -37,8 +37,8 @@ int main() { assert((dev1 == dev2) && "Device 1 == Device 2"); assert((plat1 == plat2) && "Platform 1 == Platform 2"); - device h1; - device h2; + device h1{host_selector{}}; + device h2{host_selector{}}; assert(h1.is_host() && "Device h1 is host"); assert(h2.is_host() && "Device h2 is host"); diff --git a/SYCL/FilterSelector/select.cpp b/SYCL/FilterSelector/select.cpp index b1400f9726..be3c4432ef 100644 --- a/SYCL/FilterSelector/select.cpp +++ b/SYCL/FilterSelector/select.cpp @@ -23,7 +23,6 @@ int main() { std::vector GPUs; std::vector Accels; std::vector Devs; - device host; CPUs = device::get_devices(info::device_type::cpu); GPUs = device::get_devices(info::device_type::gpu); diff --git a/SYCL/USM/pointer_query.cpp b/SYCL/USM/pointer_query.cpp index 8f12fa5358..7280406acd 100644 --- a/SYCL/USM/pointer_query.cpp +++ b/SYCL/USM/pointer_query.cpp @@ -29,7 +29,6 @@ int main() { return 0; usm::alloc Kind; - device D; // Test device allocs array = (int *)malloc_device(N * sizeof(int), q); @@ -48,7 +47,7 @@ int main() { return 3; } } - D = get_pointer_device(array, ctxt); + device D = get_pointer_device(array, ctxt); if (D != dev) { return 4; }