24 static constexpr int32_t value = _N;
25 static constexpr int32_t default_value = 0;
28 template <
int32_t _N>
struct cache {
29 static constexpr int32_t value = _N;
30 static constexpr int32_t default_value = 0;
34 static constexpr int32_t value = _N;
35 static constexpr int32_t default_value = 0;
39 static constexpr int32_t value = _N;
40 static constexpr int32_t default_value = 1;
47 template <
class... _mem_access_params>
class lsu final {
51 template <
typename _T, access::address_space _space>
53 check_space<_space>();
55 #if defined(__SYCL_DEVICE_ONLY__) && __has_builtin(__builtin_intel_fpga_mem)
56 return *__builtin_intel_fpga_mem((_T *)Ptr,
57 _burst_coalesce | _cache |
58 _dont_statically_coalesce | _prefetch,
65 template <
typename _T, access::address_space _space>
67 check_space<_space>();
69 #if defined(__SYCL_DEVICE_ONLY__) && __has_builtin(__builtin_intel_fpga_mem)
70 *__builtin_intel_fpga_mem((_T *)Ptr,
71 _burst_coalesce | _cache |
72 _dont_statically_coalesce | _prefetch,
80 static constexpr int32_t _burst_coalesce_val =
82 static constexpr uint8_t _burst_coalesce =
85 static constexpr int32_t _cache_val =
87 static constexpr uint8_t _cache = (_cache_val > 0) ?
CACHE : 0;
89 static constexpr int32_t _statically_coalesce_val =
91 static constexpr uint8_t _dont_statically_coalesce =
94 static constexpr int32_t _prefetch_val =
96 static constexpr uint8_t _prefetch = _prefetch_val ?
PREFETCH : 0;
98 static_assert(_cache_val >= 0,
"cache size parameter must be non-negative");
100 template <access::address_space _space>
static void check_space() {
102 _space == access::address_space::global_space ||
103 _space == access::address_space::ext_intel_global_device_space ||
104 _space == access::address_space::ext_intel_global_host_space,
105 "lsu controls are only supported for global_ptr, "
106 "device_ptr, and host_ptr objects");
109 static void check_load() {
111 "unable to implement a cache without a burst coalescer");
112 static_assert(_prefetch == 0 || _burst_coalesce == 0,
113 "unable to implement a prefetcher and a burst coalescer "
116 _prefetch == 0 || _cache == 0,
117 "unable to implement a prefetcher and a cache simulataneously");
119 static void check_store() {
120 static_assert(_cache == 0,
"unable to implement a store LSU with a cache.");
121 static_assert(_prefetch == 0,
122 "unable to implement a store LSU with a prefetcher.");