@@ -47,7 +47,9 @@ template <class... _mem_access_params> class lsu final {
47
47
public:
48
48
lsu () = delete ;
49
49
50
- template <typename _T> static _T load (sycl::global_ptr<_T> Ptr) {
50
+ template <typename _T, access::address_space _space>
51
+ static _T load (sycl::multi_ptr<_T, _space> Ptr) {
52
+ check_space<_space>();
51
53
check_load ();
52
54
#if defined(__SYCL_DEVICE_ONLY__) && __has_builtin(__builtin_intel_fpga_mem)
53
55
return *__builtin_intel_fpga_mem ((_T *)Ptr,
@@ -59,7 +61,9 @@ template <class... _mem_access_params> class lsu final {
59
61
#endif
60
62
}
61
63
62
- template <typename _T> static void store (sycl::global_ptr<_T> Ptr, _T Val) {
64
+ template <typename _T, access::address_space _space>
65
+ static void store (sycl::multi_ptr<_T, _space> Ptr, _T Val) {
66
+ check_space<_space>();
63
67
check_store ();
64
68
#if defined(__SYCL_DEVICE_ONLY__) && __has_builtin(__builtin_intel_fpga_mem)
65
69
*__builtin_intel_fpga_mem ((_T *)Ptr,
@@ -92,6 +96,14 @@ template <class... _mem_access_params> class lsu final {
92
96
93
97
static_assert (_cache_val >= 0 , " cache size parameter must be non-negative" );
94
98
99
+ template <access::address_space _space> static void check_space () {
100
+ static_assert (_space == access::address_space::global_space ||
101
+ _space == access::address_space::global_device_space ||
102
+ _space == access::address_space::global_host_space,
103
+ " lsu controls are only supported for global_ptr, "
104
+ " device_ptr, and host_ptr objects" );
105
+ }
106
+
95
107
static void check_load () {
96
108
static_assert (_cache == 0 || _burst_coalesce == BURST_COALESCE,
97
109
" unable to implement a cache without a burst coalescer" );
0 commit comments