This repository was archived by the owner on Apr 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Kokkos::ExecutionSpaceConcept
Christian Trott edited this page Dec 1, 2020
·
3 revisions
// This is not an actual class, it just describes the concept in shorthand
class ExecutionSpaceConcept {
public:
typedef ExecutionSpaceConcept execution_space;
typedef ... memory_space;
typedef Device<execution_space, memory_space> device_type;
typedef ... scratch_memory_space;
typedef ... array_layout;
ExecutionSpaceConcept();
ExecutionSpaceConcept(const ExecutionSpaceConcept& src);
const char* name() const;
void print_configuration(std::ostream ostr&) const;
void print_configuration(std::ostream ostr&, bool details) const;
bool in_parallel() const;
int concurrency() const;
void fence() const;
};
template<class MS>
struct is_execution_space {
enum { value = false };
};
template<>
struct is_execution_space<ExecutionSpaceConcept> {
enum { value = true };
};-
execution_space: The self type; -
memory_space: The defaultMemorySpaceto use when executing withExecutionSpaceConcept.
Kokkos guarantees thatKokkos::SpaceAccessibility<Ex, Ex::memory_space>::accessiblewill betrue(seeKokkos::SpaceAccessibility) -
device_type:DeviceType<execution_space,memory_space>. -
array_layout: The defaultArrayLayoutrecommended for use withViewtypes accessed fromExecutionSpaceConcept. -
scratch_memory_space: TheScratchMemorySpacethat parallel patterns will use for allocation of scratch memory (for instance, as requested by aKokkos::TeamPolicy)
-
ExecutionSpaceConcept(): Default constructor. -
ExecutionSpaceConcept(const ExecutionSpaceConcept& src): Copy constructor.
-
const char* name() const;: Returns the label of the execution space instance. -
bool in_parallel() const;: Returns a value convertible toboolindicating whether or not the caller is executing as part of a Kokkos parallel pattern. Note: as currently implemented, there is no guarantee thattruemeans the caller is necessarily executing as part of a pattern on the particular instanceExecutionSpaceConcept; just some instance ofExecutionSpaceConcept. This may be strengthened in the future. -
int concurrency() const;Returns the maximum amount of concurrently executing work items in a parallel setting, i.e. the maximum number of threads utilized by an execution space instance. -
void fence() const;Effects: Upon return, all parallel patterns executed on the instanceExecutionSpaceConceptare guaranteed to have completed, and their effects are guaranteed visible to the calling thread. Note: This cannot be called from within a parallel pattern. Doing so will lead to unspecified effects (i.e., it might work, but only for some execution spaces, so be extra careful not to do it). -
void print_configuration(std::ostream ostr) const;: Effects: Outputs the configuration ofexto the givenstd::ostream. Note: This cannot be called from within a parallel pattern.
-
template<class MS> struct is_execution_space;: typetrait to check whether a class is a execution space. -
template<class S1, class S2> struct SpaceAccessibility;: typetraits to check whether two spaces are compatible (assignable, deep_copy-able, accessable). (seeKokkos::SpaceAccessibility)
Home:
- Introduction
- Machine Model
- Programming Model
- Compiling
- Initialization
- View
- Parallel Dispatch
- Hierarchical Parallelism
- Custom Reductions
- Atomic Operations
- Subviews
- Interoperability
- Kokkos and Virtual Functions
- Initialization and Finalization
- View
- Data Parallelism
- Execution Policies
- Spaces
- Task Parallelism
- Utilities
- STL Compatibility
- Numerics
- Detection Idiom