alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
GridSyncGenericSycl.hpp
Go to the documentation of this file.
1/* Copyright 2026 Mykhailo Varvarin
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
10
11#ifdef ALPAKA_ACC_SYCL_ENABLED
12
13# include <sycl/ext/oneapi/experimental/root_group.hpp>
14# include <sycl/sycl.hpp>
15
16namespace alpaka
17{
18 //! The grid synchronization for SYCL.
19 template<typename TDim>
20 class GridSyncGenericSycl : public interface::Implements<ConceptGridSync, GridSyncGenericSycl<TDim>>
21 {
22 public:
23 GridSyncGenericSycl(sycl::nd_item<TDim::value> work_item) : my_item{work_item}
24 {
25 }
26
27 sycl::nd_item<TDim::value> my_item;
28 };
29
30 namespace trait
31 {
32 template<typename TDim>
33 struct SyncGridThreads<GridSyncGenericSycl<TDim>>
34 {
36 ALPAKA_FN_ACC static auto syncGridThreads(GridSyncGenericSycl<TDim> const& gridSync) -> void
37 {
38 sycl::group_barrier(gridSync.my_item.ext_oneapi_get_root_group());
39 }
40 };
41
42 } // namespace trait
43
44} // namespace alpaka
45
46#endif
#define ALPAKA_FN_ACC
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_F...
Definition Common.hpp:41
#define ALPAKA_NO_HOST_ACC_WARNING
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_...
Definition Common.hpp:85
The alpaka accelerator library.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_ACC auto syncGridThreads(TGridSync const &gridSync) -> void
Synchronizes all threads within the current grid. Works only for cooperative kernels....
Definition Traits.hpp:33