@@ -29,7 +29,7 @@ static std::pair<hid_t, hid_t> allocation_window_to_dataspace(const celerity::bu
2929
3030static void read_hdf5_file (celerity::distr_queue& q, const celerity::buffer<float , 2 >& buffer, const char * file_name) {
3131 q.submit ([=](celerity::handler& cgh) {
32- auto a = buffer. get_access <cl::sycl::access::mode::discard_write, celerity::target::host_task>( cgh, celerity::experimental::access::even_split<2 >()) ;
32+ celerity::accessor a{ buffer, cgh, celerity::experimental::access::even_split<2 >{}, celerity::write_only_host_task, celerity::no_init} ;
3333 cgh.host_task (celerity::experimental::collective, [=](celerity::experimental::collective_partition part) {
3434 auto plist = H5Pcreate (H5P_FILE_ACCESS);
3535 H5Pset_fapl_mpio (plist, part.get_collective_mpi_comm (), MPI_INFO_NULL);
@@ -56,7 +56,7 @@ static void read_hdf5_file(celerity::distr_queue& q, const celerity::buffer<floa
5656
5757static void write_hdf5_file (celerity::distr_queue& q, const celerity::buffer<float , 2 >& buffer, const char * file_name) {
5858 q.submit ([=](celerity::handler& cgh) {
59- auto a = buffer. get_access <cl::sycl::access::mode::read, celerity::target::host_task>( cgh, celerity::experimental::access::even_split<2 >()) ;
59+ celerity::accessor a{ buffer, cgh, celerity::experimental::access::even_split<2 >{}, celerity::read_only_host_task} ;
6060 cgh.host_task (celerity::experimental::collective, [=](celerity::experimental::collective_partition part) {
6161 auto plist = H5Pcreate (H5P_FILE_ACCESS);
6262 H5Pset_fapl_mpio (plist, part.get_collective_mpi_comm (), MPI_INFO_NULL);
@@ -119,8 +119,8 @@ int main(int argc, char* argv[]) {
119119 read_hdf5_file (q, in, argv[2 ]);
120120
121121 q.submit ([=](celerity::handler& cgh) {
122- auto a = in. get_access <cl::sycl::access::mode::read>( cgh, celerity::access::one_to_one{}) ;
123- auto b = out. get_access <cl::sycl::access::mode::discard_write>(cgh, transposed) ;
122+ celerity::accessor a{in, cgh, celerity::access::one_to_one{}, celerity::read_only} ;
123+ celerity::accessor b{out, cgh, transposed, celerity::write_only, celerity::no_init} ;
124124 cgh.parallel_for <class transpose >(celerity::range<2 >{N, N}, [=](celerity::item<2 > item) {
125125 auto id = item.get_id ();
126126 b[{id[1 ], id[0 ]}] = a[id];
@@ -140,8 +140,8 @@ int main(int argc, char* argv[]) {
140140 read_hdf5_file (q, right, argv[3 ]);
141141
142142 q.submit (celerity::allow_by_ref, [=, &equal](celerity::handler& cgh) {
143- auto a = left. get_access <cl::sycl::access::mode::read, celerity::target::host_task>( cgh, celerity::access::all{}) ;
144- auto b = right. get_access <cl::sycl::access::mode::read, celerity::target::host_task>( cgh, celerity::access::all{}) ;
143+ celerity::accessor a{ left, cgh, celerity::access::all{}, celerity::read_only_host_task} ;
144+ celerity::accessor b{ right, cgh, celerity::access::all{}, celerity::read_only_host_task} ;
145145 cgh.host_task (celerity::on_master_node, [=, &equal] {
146146 for (size_t i = 0 ; i < N; ++i) {
147147 for (size_t j = 0 ; j < N; ++j) {
0 commit comments