-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cooperative groups and grid sync functionality to SYCL
- Loading branch information
1 parent
7cf652e
commit aaed855
Showing
14 changed files
with
277 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* Copyright 2024 Mykhailo Varvarin | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "alpaka/core/Concepts.hpp" | ||
#include "alpaka/grid/Traits.hpp" | ||
|
||
#ifdef ALPAKA_ACC_SYCL_ENABLED | ||
|
||
# include <sycl/ext/oneapi/experimental/root_group.hpp> | ||
# include <sycl/sycl.hpp> | ||
|
||
namespace alpaka | ||
{ | ||
//! The grid synchronization for SYCL. | ||
template<typename TDim> | ||
class GridSyncGenericSycl : public concepts::Implements<ConceptGridSync, GridSyncGenericSycl<TDim>> | ||
{ | ||
public: | ||
GridSyncGenericSycl(sycl::nd_item<TDim::value> work_item) : my_item{work_item} | ||
{ | ||
} | ||
|
||
sycl::nd_item<TDim::value> my_item; | ||
}; | ||
|
||
namespace trait | ||
{ | ||
template<typename TDim> | ||
struct SyncGridThreads<GridSyncGenericSycl<TDim>> | ||
{ | ||
ALPAKA_NO_HOST_ACC_WARNING | ||
ALPAKA_FN_ACC static auto syncGridThreads(GridSyncGenericSycl<TDim> const& gridSync) -> void | ||
{ | ||
sycl::group_barrier(gridSync.my_item.ext_oneapi_get_root_group()); | ||
} | ||
}; | ||
|
||
} // namespace trait | ||
|
||
} // namespace alpaka | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.