Commit 82dbc8a
committed
[NFCI][SYCL] Refactor reductions implementations
The purpose of this change is
1) Make it clear that sycl::range version always delegates to some
sycl::nd_range implementation.
2) Flatten all existing implementations. That required splitting
reduction_parallel_for_basic_impl depending on
Reduction::has_fast_reduce. However, I also inlined its helper
routines (that now had unambigious branches for "if
constexpr (Reduction::*)") so the ratio between duplicate/unique code
isn't bad at all.
3) Make a unique dispatching entry and have all the implementations
provide the same interface. I plan to use it in unit-tests to bypass
the dispatch and test all the implementation directly (when
applicable based on nd_range/BinOp/HW/etc.).
I'd say 90% of the change is straightforward code movement with the
exceptions of
- Inlining described above
- Simplifying __sycl_reduction_kernel helper enabled by this change
- Factoring out forward declarations in handler.hpp into a separate
reduction_fwd.hpp
- Rewriting dispatcher routine - caused by changes in the interfaces,
not logic updates.1 parent cda6680 commit 82dbc8a
File tree
7 files changed
+942
-916
lines changed- sycl
- include/sycl
- test/extensions/properties
7 files changed
+942
-916
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | 272 | | |
276 | 273 | | |
277 | 274 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | 275 | | |
309 | 276 | | |
310 | 277 | | |
| |||
0 commit comments