Skip to content

Commit efe6331

Browse files
author
Alexander Batashev
authored
[SYCL][NFC] Improve testing for accessor_property_list (#2532)
Followup on comments from previous review.
1 parent 3faeb77 commit efe6331

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

sycl/test/basic_tests/accessor/accessor_property_list_ct.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
using namespace sycl::ONEAPI;
88

9+
void foo(sycl::accessor<int, 1, sycl::access::mode::read_write,
10+
sycl::access::target::global_buffer,
11+
sycl::access::placeholder::true_t,
12+
accessor_property_list<property::no_alias::instance<>,
13+
property::no_offset::instance<>>>
14+
acc) {}
15+
916
int main() {
1017
{
1118
// Create empty property list
@@ -36,6 +43,26 @@ int main() {
3643
"Properties are not equal");
3744
}
3845

46+
{
47+
// Property list copy
48+
accessor_property_list PL{no_alias, sycl::noinit};
49+
50+
accessor_property_list PL_1{PL};
51+
static_assert(PL_1.has_property<property::no_alias>(),
52+
"Property not found");
53+
}
54+
55+
{
56+
// Conversion
57+
accessor_property_list PL{no_offset, no_alias};
58+
int *data = nullptr;
59+
sycl::buffer<int, 1> buf_data(data, sycl::range<1>(1),
60+
{sycl::property::buffer::use_host_ptr()});
61+
62+
sycl::accessor acc_1(buf_data, PL);
63+
foo(acc_1);
64+
}
65+
3966
{
4067
int data[1] = {0};
4168

sycl/test/fpga_tests/buffer_location.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clangxx -fsycl %s -o %t.out
2-
// RUNx: %ACC_RUN_PLACEHOLDER %t.out
2+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
33

44
#include <CL/sycl.hpp>
55

0 commit comments

Comments
 (0)