MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / testNeedsReduction

Function testNeedsReduction

src/backend/oneapi/reduce_impl.hpp:248–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246
247template<typename Tk>
248void testNeedsReduction(sycl::buffer<int> needs_reduction,
249 sycl::buffer<int> needs_boundary, const Array<Tk> &keys,
250 const int n, const int numBlocks, const int threads_x) {
251 sycl::range<1> local(threads_x);
252 sycl::range<1> global(local[0] * numBlocks);
253
254 auto keys_get = keys.get();
255 getQueue().submit([&](sycl::handler &h) {
256 sycl::accessor<int> needs_reduction_acc{needs_reduction, h};
257 sycl::accessor<int> needs_boundary_acc{needs_boundary, h};
258 read_accessor<Tk> keys_acc{*keys_get, h};
259 auto l_keys = sycl::local_accessor<Tk>(threads_x, h);
260
261 h.parallel_for(sycl::nd_range<1>(global, local),
262 kernel::testNeedsReductionKernel<Tk>(
263 needs_reduction_acc, needs_boundary_acc, keys_acc,
264 keys, n, threads_x, l_keys));
265 });
266 ONEAPI_DEBUG_FINISH(getQueue());
267}
268
269template<af_op_t op, typename Ti, typename Tk, typename To>
270int reduce_by_key_first(Array<Tk> &keys_out, Array<To> &vals_out,

Callers

nothing calls this directly

Calls 2

getQueueFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected