From 435bc8ec0eecb66381f1fa3f328fe5a900eeaa64 Mon Sep 17 00:00:00 2001 From: Alexander Batashev <alexander.batashev@intel.com> Date: Thu, 24 Sep 2020 10:29:56 +0300 Subject: [PATCH] [SYCL][NFC] Improve testing for accessor_property_list Followup on comments from previous review. --- .../accessor/accessor_property_list_ct.cpp | 27 +++++++++++++++++++ .../buffer_location_codegen.cpp | 0 sycl/test/fpga_tests/buffer_location.cpp | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) rename sycl/test/{fpga_tests => check_device_code}/buffer_location_codegen.cpp (100%) diff --git a/sycl/test/basic_tests/accessor/accessor_property_list_ct.cpp b/sycl/test/basic_tests/accessor/accessor_property_list_ct.cpp index 5a40a4da476e9..e757ad3f4751b 100644 --- a/sycl/test/basic_tests/accessor/accessor_property_list_ct.cpp +++ b/sycl/test/basic_tests/accessor/accessor_property_list_ct.cpp @@ -6,6 +6,13 @@ using namespace sycl::ONEAPI; +void foo(sycl::accessor<int, 1, sycl::access::mode::read_write, + sycl::access::target::global_buffer, + sycl::access::placeholder::true_t, + accessor_property_list<property::no_alias::instance<>, + property::no_offset::instance<>>> + acc) {} + int main() { { // Create empty property list @@ -36,6 +43,26 @@ int main() { "Properties are not equal"); } + { + // Property list copy + accessor_property_list PL{no_alias, sycl::noinit}; + + accessor_property_list PL_1{PL}; + static_assert(PL_1.has_property<property::no_alias>(), + "Property not found"); + } + + { + // Conversion + accessor_property_list PL{no_offset, no_alias}; + int *data = nullptr; + sycl::buffer<int, 1> buf_data(data, sycl::range<1>(1), + {sycl::property::buffer::use_host_ptr()}); + + sycl::accessor acc_1(buf_data, PL); + foo(acc_1); + } + { int data[1] = {0}; diff --git a/sycl/test/fpga_tests/buffer_location_codegen.cpp b/sycl/test/check_device_code/buffer_location_codegen.cpp similarity index 100% rename from sycl/test/fpga_tests/buffer_location_codegen.cpp rename to sycl/test/check_device_code/buffer_location_codegen.cpp diff --git a/sycl/test/fpga_tests/buffer_location.cpp b/sycl/test/fpga_tests/buffer_location.cpp index 611b51d52d8bb..aad641c462556 100644 --- a/sycl/test/fpga_tests/buffer_location.cpp +++ b/sycl/test/fpga_tests/buffer_location.cpp @@ -1,5 +1,5 @@ // RUN: %clangxx -fsycl %s -o %t.out -// RUNx: %ACC_RUN_PLACEHOLDER %t.out +// RUN: %ACC_RUN_PLACEHOLDER %t.out #include <CL/sycl.hpp>