MLX
 
Loading...
Searching...
No Matches
ops.h File Reference
#include <metal_atomic>
#include <metal_simdgroup>

Go to the source code of this file.

Classes

union  bool4_or_uint
 
struct  None
 
struct  And< U >
 
struct  Or< U >
 
struct  Sum< U >
 
struct  Prod< U >
 
struct  Min< U >
 
struct  Max< U >
 

Macros

#define DEFINE_SIMD_REDUCE()
 

Variables

static constant constexpr const uint8_t simd_size = 32
 

Macro Definition Documentation

◆ DEFINE_SIMD_REDUCE

#define DEFINE_SIMD_REDUCE ( )
Value:
template <typename T, metal::enable_if_t<sizeof(T) < 8, bool> = true> \
T simd_reduce(T val) { \
return simd_reduce_impl(val); \
} \
\
template <typename T, metal::enable_if_t<sizeof(T) == 8, bool> = true> \
T simd_reduce(T val) { \
for (short i = simd_size / 2; i > 0; i /= 2) { \
val = operator()(val, simd_shuffle_down(val, i)); \
} \
return val; \
}
static constant constexpr const uint8_t simd_size
Definition ops.h:22
uint64_t simd_shuffle_down(uint64_t data, uint16_t delta)
Definition utils.h:335

Variable Documentation

◆ simd_size

constant constexpr const uint8_t simd_size = 32
staticconstexpr