| 218 | |
| 219 | template<typename T> |
| 220 | T getScalar(const Array<T> &in) { |
| 221 | T retVal{}; |
| 222 | |
| 223 | auto in_get = in.get(); |
| 224 | getQueue() |
| 225 | .submit([&](sycl::handler &h) { |
| 226 | auto acc_in = |
| 227 | in_get->template get_access<sycl::access::mode::read>( |
| 228 | h, sycl::range{1}, |
| 229 | sycl::id{static_cast<uintl>(in.getOffset())}); |
| 230 | h.copy(acc_in, &retVal); |
| 231 | }) |
| 232 | .wait(); |
| 233 | |
| 234 | return retVal; |
| 235 | } |
| 236 | |
| 237 | #define INSTANTIATE_GETSCALAR(T) template T getScalar(const Array<T> &in); |
| 238 |