MLX
 
Loading...
Searching...
No Matches
binary_ops.h File Reference

Go to the source code of this file.

Classes

struct  mlx::core::detail::Add
 
struct  mlx::core::detail::ArcTan2
 
struct  mlx::core::detail::Divide
 
struct  mlx::core::detail::Multiply
 
struct  mlx::core::detail::Subtract
 
struct  mlx::core::detail::LogicalAnd
 
struct  mlx::core::detail::LogicalOr
 
struct  mlx::core::detail::BitwiseAnd
 
struct  mlx::core::detail::BitwiseOr
 
struct  mlx::core::detail::BitwiseXor
 
struct  mlx::core::detail::LeftShift
 
struct  mlx::core::detail::RightShift
 
struct  mlx::core::detail::Remainder
 
struct  mlx::core::detail::Maximum
 
struct  mlx::core::detail::Minimum
 
struct  mlx::core::detail::Power
 
struct  mlx::core::detail::Equal
 
struct  mlx::core::detail::Greater
 
struct  mlx::core::detail::GreaterEqual
 
struct  mlx::core::detail::Less
 
struct  mlx::core::detail::LessEqual
 
struct  mlx::core::detail::NotEqual
 
struct  mlx::core::detail::NaNEqual
 
struct  mlx::core::detail::LogAddExp
 
struct  mlx::core::detail::Select
 

Namespaces

namespace  mlx
 
namespace  mlx::core
 
namespace  mlx::core::detail
 

Macros

#define BINARY_SINGLE()
 
#define DEFAULT_BINARY_OP(Op, op)
 
#define DEFAULT_BOOL_OP(Op, op)
 

Macro Definition Documentation

◆ BINARY_SINGLE

#define BINARY_SINGLE ( )
Value:
template <typename T> \
T operator()(T x, T y) { \
return (*this)(Simd<T, 1>(x), Simd<T, 1>(y)).value; \
}

◆ DEFAULT_BINARY_OP

#define DEFAULT_BINARY_OP ( Op,
op )
Value:
struct Op { \
template <int N, typename T> \
Simd<T, N> operator()(Simd<T, N> x, Simd<T, N> y) { \
return op(x, y); \
} \
BINARY_SINGLE() \
};

◆ DEFAULT_BOOL_OP

#define DEFAULT_BOOL_OP ( Op,
op )
Value:
struct Op { \
template <int N, typename T> \
Simd<bool, N> operator()(Simd<T, N> x, Simd<T, N> y) { \
return op(x, y); \
} \
template <typename T> \
bool operator()(T x, T y) { \
return (*this)(Simd<T, 1>(x), Simd<T, 1>(y)).value; \
} \
};