Go to the documentation of this file.
9 template <
int rank,
int myStyle>
12 if (!mask.initialized()) {
yakl_throw(
"ERROR: calling count on an array that has not been initialized"); }
15 for (
int i=0; i < mask.totElems(); i++) {
16 if (mask.data()[i]) { numTrue++; }
21 template <
int rank,
int myStyle>
24 if (!mask.initialized()) {
yakl_throw(
"ERROR: calling count on an array that has not been initialized"); }
26 auto intarr = mask.template createDeviceObject<int>();
32 template <
int rank,
class D0,
class D1,
class D2,
class D3>
35 for (
int i=0; i < mask.
totElems(); i++) {
36 if (mask.
data()[i]) { numTrue++; }
41 template <
int rank,
unsigned D0,
unsigned D1,
unsigned D2,
unsigned D3>
44 for (
int i=0; i < mask.
totElems(); i++) {
45 if (mask.
data()[i]) { numTrue++; }
static constexpr unsigned totElems()
Get the total number of array elements.
Definition: YAKL_FSArray.h:179
Implements the functionality of a stream for parallel kernel execution. If the Stream::create() metho...
Definition: YAKL_streams_events.h:394
int count(Array< bool, rank, memHost, myStyle > const &mask)
Definition: YAKL_intrinsics_count.h:10
void parallel_for(char const *str, Bounds< N, simple > const &bounds, F const &f, LaunchConfig< VecLen, B4B > config=LaunchConfig<>())
[ASYNCHRONOUS] Launch the passed functor in parallel.
#define __YAKL_NAMESPACE_WRAPPER_END__
Definition: YAKL.h:20
#define __YAKL_NAMESPACE_WRAPPER_BEGIN__
Definition: YAKL.h:19
LaunchConfig<> DefaultLaunchConfig
This launch configuration sets vector length to the device default and B4B to false.
Definition: YAKL_LaunchConfig.h:77
#define YAKL_INLINE
Used to decorate functions called from kernels (parallel_for and parallel_outer) or from CPU function...
Definition: YAKL_defines.h:140
T sum(Array< T, rank, memHost, myStyle > const &arr)
Definition: YAKL_intrinsics_sum.h:10
YAKL_INLINE void yakl_throw(const char *msg)
Throw an error message. Works from the host or device.
Definition: YAKL_error.h:17
This declares the yakl::Array class. Please see the yakl::styleC and yakl::styleFortran template spec...
Definition: YAKL_Array.h:40
C-style array on the stack similar in nature to, e.g., float arr[ny][nx];
Definition: YAKL_CSArray.h:30
static constexpr unsigned totElems()
Get the total number of array elements.
Definition: YAKL_CSArray.h:131
YAKL_INLINE T * data() const
Get the underlying raw data pointer.
Definition: YAKL_CSArray.h:123
YAKL_INLINE T * data() const
Get the underlying raw data pointer.
Definition: YAKL_FSArray.h:171
#define YAKL_LAMBDA
Used to create C++ lambda expressions passed to parallel_for and parallel_outer
Definition: YAKL_defines.h:128
Fortran-style array on the stack similar in nature to, e.g., float arr[ny][nx];
Definition: YAKL_FSArray.h:53