Skip to content
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

[NFC] Update template get_access call in multi_ptr header #907

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
4 changes: 3 additions & 1 deletion tests/multi_ptr/multi_ptr_access_members.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ class run_access_members_tests {
test_device_code(priv_val_mptr);
});
} else {
auto acc_for_multi_ptr = val_buffer.template get_access(cgh);
auto acc_for_multi_ptr =
val_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
cgh.single_task<kname>([=] { test_device_code(acc_for_multi_ptr); });
}
});
Expand Down
3 changes: 2 additions & 1 deletion tests/multi_ptr/multi_ptr_arithmetic_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class run_multi_ptr_arithmetic_op_test {
auto test_result_acc =
test_result_buffer.template get_access<sycl::access_mode::write>(
cgh);
auto arr_acc = arr_buffer.template get_access(cgh);
auto arr_acc =
arr_buffer.template get_access<sycl::access_mode::read_write>(cgh);

if constexpr (space == sycl::access::address_space::local_space) {
sycl::local_accessor<T, 1> acc_for_mptr{sycl::range(m_array_size),
Expand Down
3 changes: 2 additions & 1 deletion tests/multi_ptr/multi_ptr_common_assignment_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class run_common_assign_tests {
using kname = kernel_common_assignment_ops<T, AddrSpaceT, IsDecorated>;
auto res_acc =
res_buf.template get_access<sycl::access_mode::write>(cgh);
auto val_acc = val_buffer.template get_access(cgh);
auto val_acc =
val_buffer.template get_access<sycl::access_mode::read_write>(cgh);
if constexpr (space == sycl::access::address_space::global_space ||
space == sycl::access::address_space::generic_space) {
cgh.single_task<kname>([=] {
Expand Down
3 changes: 2 additions & 1 deletion tests/multi_ptr/multi_ptr_common_constructors.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ void run_tests(sycl_cts::util::logger &log, const std::string &type_name) {

queue.submit([&](sycl::handler &cgh) {
using kname = kernel_common_constructors<T, Space, Decorated>;
auto ref_acc = ref_buf.template get_access(cgh);
auto ref_acc =
ref_buf.template get_access<sycl::access_mode::read_write>(cgh);
auto same_type_acc =
same_type_buf.template get_access<sycl::access_mode::write>(cgh);
auto same_value_acc =
Expand Down
4 changes: 3 additions & 1 deletion tests/multi_ptr/multi_ptr_comparison_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ class run_multi_ptr_comparison_op_test {
queue.submit([&](sycl::handler &cgh) {
using kname =
kernel_comparison_op<T, AddrSpaceT, IsDecoratedT, KernelName>;
auto array_acc = array_buffer.template get_access(cgh);
auto array_acc =
array_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
auto test_result_acc =
test_result_buffer.template get_access<sycl::access_mode::write>(
cgh);
Expand Down
12 changes: 9 additions & 3 deletions tests/multi_ptr/multi_ptr_convert_assignment_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ class run_convert_assignment_operators_tests {
SrcIsDecorated, DstIsDecorated>;
auto res_acc =
res_buf.template get_access<sycl::access_mode::write>(cgh);
auto acc_for_mptr = val_buffer.template get_access(cgh);
auto acc_for_mptr =
val_buffer.template get_access<sycl::access_mode::read_write>(
cgh);

if constexpr (src_space ==
sycl::access::address_space::global_space) {
auto val_acc = val_buffer.template get_access(cgh);
auto val_acc =
val_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
cgh.single_task<kname>([=] {
const src_multi_ptr_t mptr_in(acc_for_mptr);
dst_multi_ptr_t mptr_out;
Expand Down Expand Up @@ -155,7 +159,9 @@ class run_convert_assignment_operators_tests {

if constexpr (src_space ==
sycl::access::address_space::global_space) {
auto val_acc = val_buffer.template get_access(cgh);
auto val_acc =
val_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
cgh.single_task<kname>([=] {
const src_multi_ptr_t mptr_in(val_acc);
dst_multi_ptr_t mptr_out;
Expand Down
4 changes: 3 additions & 1 deletion tests/multi_ptr/multi_ptr_explicit_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class run_explicit_convert_tests {
res_buf.template get_access<sycl::access_mode::write>(cgh);
if constexpr (target_space ==
sycl::access::address_space::global_space) {
auto val_acc = val_buffer.template get_access(cgh);
auto val_acc =
val_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
cgh.single_task<kname>([=] {
input_multi_ptr_t<T> mptr_in(val_acc);
auto mptr_out =
Expand Down
4 changes: 3 additions & 1 deletion tests/multi_ptr/multi_ptr_implicit_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ class run_implicit_convert_tests {
test_device_code(priv_val_mptr);
});
} else {
auto expected_val_acc = expected_val_buffer.template get_access(cgh);
auto expected_val_acc =
expected_val_buffer
.template get_access<sycl::access_mode::read_write>(cgh);
cgh.single_task<kname>([=] { test_device_code(expected_val_acc); });
}
});
Expand Down
4 changes: 3 additions & 1 deletion tests/multi_ptr/multi_ptr_prefetch_member.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class run_prefetch_test {
queue.submit([&](sycl::handler &cgh) {
auto res_acc =
res_buf.template get_access<sycl::access_mode::write>(cgh);
auto acc_for_mptr = val_buffer.template get_access(cgh);
auto acc_for_mptr =
val_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
cgh.single_task<kernel_prefetch_member<T, IsDecoratedT>>([=] {
const multi_ptr_t mptr(acc_for_mptr);

Expand Down
8 changes: 6 additions & 2 deletions tests/multi_ptr/multi_ptr_subscript_op_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ class run_subscript_op_tests {
test_device_code(priv_arr_mptr, multi_ptr_negative);
});
} else {
auto exp_arr_acc = exp_arr_buffer.template get_access(cgh);
auto exp_arr_neg_acc = exp_arr_buffer.template get_access(cgh);
auto exp_arr_acc =
exp_arr_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
auto exp_arr_neg_acc =
exp_arr_buffer.template get_access<sycl::access_mode::read_write>(
cgh);
cgh.single_task([=] {
T *arr_end = const_cast<T *>(&exp_arr_neg_acc[array_size - 1]);
multi_ptr_t multi_ptr_negative =
Expand Down
Loading