Skip to content

Commit

Permalink
Explain acquire_team_scratch_space
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Mar 22, 2023
1 parent c5d2c3d commit a798ac7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/SYCL/Kokkos_SYCL_Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ void SYCLInternal::initialize(const sycl::queue& q) {
}

int SYCLInternal::acquire_team_scratch_space() {
// Grab the next scratch memory allocation. We must make sure that the last
// kernel using the allocation has completed, so we wait for the event that
// was registered with that kernel.
int current_team_scratch = desul::atomic_fetch_inc_mod(
&m_current_team_scratch, m_n_team_scratch - 1,
desul::MemoryOrderRelaxed(), desul::MemoryScopeDevice());
Expand Down

0 comments on commit a798ac7

Please sign in to comment.