Go to the documentation of this file.
9 template <
class T1,
class T2>
12 template <
class T1,
class T2,
int rank,
int myStyle>
16 using yakl::componentwise::operator==;
17 using yakl::componentwise::operator!;
22 auto ret = a.createHostObject();
23 for(
int i=0; i < a.totElems(); i++) {
24 ret.data()[i] = b.data()[i] >= 0 ?
std::abs(a.data()[i]) : -
std::abs(a.data()[i]);
29 template <
class T1,
class T2,
int rank,
int myStyle>
33 using yakl::componentwise::operator==;
34 using yakl::componentwise::operator!;
39 auto ret = a.createDeviceObject();
41 ret.data()[i] = b.data()[i] >= 0 ?
std::abs(a.data()[i]) : -
std::abs(a.data()[i]);
43 ret.set_stream_dependency(stream);
47 template <
class T1,
class T2,
int rank,
unsigned D0,
unsigned D1,
unsigned D2,
unsigned D3>
48 YAKL_INLINE SArray<T1,rank,D0,D1,D2,D3> sign(
SArray<T1,rank,D0,D1,D2,D3> const & a ,
51 for(
int i=0; i < a.
totElems(); i++) {
57 template <
class T1,
class T2,
int rank,
class B0,
class B1,
class B2,
class B3>
58 YAKL_INLINE FSArray<T1,rank,B0,B1,B2,B3> sign(
FSArray<T1,rank,B0,B1,B2,B3> const & a ,
61 for(
int i=0; i < a.
totElems(); i++) {
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
YAKL_INLINE auto shape(T const &arr)
Definition: YAKL_intrinsics_shape.h:9
YAKL_INLINE bool allocated(T const &arr)
Definition: YAKL_intrinsics_allocated.h:9
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.
YAKL_INLINE T1 sign(T1 a, T2 b)
Definition: YAKL_intrinsics_sign.h:10
#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
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 Pack< T, N > abs(Pack< T, N > a)
Definition: YAKL_simd.h:266
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
bool any(Array< T, rank, memHost, myStyle > arr)
Definition: YAKL_intrinsics_any.h:10