summaryrefslogtreecommitdiff
path: root/modules/remote-sycl/c++/data.hpp
blob: 3ad1d9c010607701852151d5f12564abec89c017 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include "common.hpp"

namespace saw {

/**
 * Generic wrapper class which stores data on the sycl side.
 * Most of the times this will be a root object.
 */
template<typename Schema>
class data<Schema, encode::Native, rmt::Sycl> {
private:
	cl::sycl::buffer<data<Schema, encode::Native, storage::Default>> data_;
public:
	data(data<Schema, encode::Native, storage::Default>& data__):
		data_{&data__, 1u}
	{}

	auto& get_handle() {
		return data_;
	}

	template<cl::sycl::access::mode AccessMode>
	auto access(cl::sycl::handler& h){
		return data_.template get_access<AccessMode>(h);
	}
};

}