A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://kokkos.github.io/kokkos-core-wiki/API/core/parallel-dispatch/fence.html below:

fence - Kokkos documentation

Toggle table of contents sidebar

fence

Header File: <Kokkos_Core.hpp>

Usage:

Blocks on completion of all outstanding asynchronous Kokkos operations. That includes parallel dispatch (e.g. parallel_for(), parallel_reduce() and parallel_scan()) as well as asynchronous data operations such as three-argument deep_copy.

Note: there is a execution space instance specific fence too: ExecutionSpaceConcept

Interface
void Kokkos::fence(const std::string& label);
Parameters Requirements Semantics Examples Timing kernels
Kokkos::Timer timer;
// This operation is asynchronous, without a fence
// one would time only the launch overhead
Kokkos::parallel_for("Test", N, functor);
Kokkos::fence();
double time = timer.seconds();
Use with asynchronous deep copy
Kokkos::deep_copy(exec1, a,b);
Kokkos::deep_copy(exec2, a,b);
// do some stuff which doesn't touch a or b
Kokkos::parallel_for("Test", N, functor);

// wait for all three operations to finish
Kokkos::fence();

// do something with a and b

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4