MLIR  19.0.0git
Classes | Functions | Variables
mlir::sparse_tensor::detail Namespace Reference

Classes

struct  is_complex
 
struct  is_complex< std::complex< T > >
 

Functions

LogicalResult stageWithSortImpl (sparse_tensor::StageWithSortSparseOp op, PatternRewriter &rewriter, Value &tmpBufs)
 
template<typename T , typename U >
constexpr bool safelyEQ (T t, U u) noexcept
 
template<typename T , typename U >
constexpr bool safelyNE (T t, U u) noexcept
 
template<typename T , typename U >
constexpr bool safelyLT (T t, U u) noexcept
 
template<typename T , typename U >
constexpr bool safelyGT (T t, U u) noexcept
 
template<typename T , typename U >
constexpr bool safelyLE (T t, U u) noexcept
 
template<typename T , typename U >
constexpr bool safelyGE (T t, U u) noexcept
 
template<typename To , typename From >
To checkOverflowCast (From x)
 A version of static_cast<To> which checks for overflow/underflow. More...
 
uint64_t checkedMul (uint64_t lhs, uint64_t rhs)
 A version of operator* on uint64_t which guards against overflows (when assertions are enabled). More...
 
template<typename V , bool IsPattern>
std::enable_if_t<!is_complex< V >::value, V > readValue (char **linePtr)
 Returns an element-value of non-complex type. More...
 
template<typename V , bool IsPattern>
std::enable_if_t< is_complex< V >::value, V > readValue (char **linePtr)
 Returns an element-value of complex type. More...
 
template<typename V >
readValue (char **linePtr, bool isPattern)
 Returns an element-value. More...
 

Variables

static constexpr unsigned kInvalidId = -1u
 A constant serving as the canonically invalid identifier, regardless of the identifier type. More...
 

Function Documentation

◆ checkedMul()

uint64_t mlir::sparse_tensor::detail::checkedMul ( uint64_t  lhs,
uint64_t  rhs 
)
inline

A version of operator* on uint64_t which guards against overflows (when assertions are enabled).

Definition at line 123 of file ArithmeticUtils.h.

References max().

Referenced by mlir::sparse_tensor::SparseTensorStorage< P, C, V >::SparseTensorStorage().

◆ checkOverflowCast()

template<typename To , typename From >
To mlir::sparse_tensor::detail::checkOverflowCast ( From  x)
inline

A version of static_cast<To> which checks for overflow/underflow.

The implementation avoids performing runtime assertions whenever the types alone are sufficient to statically prove that overflow cannot happen.

Definition at line 106 of file ArithmeticUtils.h.

References max(), min(), safelyGE(), and safelyLE().

◆ readValue() [1/3]

template<typename V , bool IsPattern>
std::enable_if_t<!is_complex<V>::value, V> mlir::sparse_tensor::detail::readValue ( char **  linePtr)
inline

Returns an element-value of non-complex type.

If IsPattern is true, then returns an arbitrary value. If IsPattern is false, then reads the value from the current line buffer beginning at linePtr.

Definition at line 43 of file File.h.

Referenced by mlir::linalg::vectorizeCopy().

◆ readValue() [2/3]

template<typename V , bool IsPattern>
std::enable_if_t<is_complex<V>::value, V> mlir::sparse_tensor::detail::readValue ( char **  linePtr)
inline

Returns an element-value of complex type.

If IsPattern is true, then returns an arbitrary value. If IsPattern is false, then reads the value from the current line buffer beginning at linePtr.

Definition at line 56 of file File.h.

◆ readValue() [3/3]

template<typename V >
V mlir::sparse_tensor::detail::readValue ( char **  linePtr,
bool  isPattern 
)
inline

Returns an element-value.

If isPattern is true, then returns an arbitrary value. If isPattern is false, then reads the value from the current line buffer beginning at linePtr.

Definition at line 73 of file File.h.

◆ safelyEQ()

template<typename T , typename U >
constexpr bool mlir::sparse_tensor::detail::safelyEQ ( t,
u 
)
constexprnoexcept

Definition at line 44 of file ArithmeticUtils.h.

Referenced by safelyNE().

◆ safelyGE()

template<typename T , typename U >
constexpr bool mlir::sparse_tensor::detail::safelyGE ( t,
u 
)
constexprnoexcept

Definition at line 83 of file ArithmeticUtils.h.

References safelyLT().

Referenced by checkOverflowCast().

◆ safelyGT()

template<typename T , typename U >
constexpr bool mlir::sparse_tensor::detail::safelyGT ( t,
u 
)
constexprnoexcept

Definition at line 73 of file ArithmeticUtils.h.

References safelyLT().

Referenced by safelyLE().

◆ safelyLE()

template<typename T , typename U >
constexpr bool mlir::sparse_tensor::detail::safelyLE ( t,
u 
)
constexprnoexcept

Definition at line 78 of file ArithmeticUtils.h.

References safelyGT().

Referenced by checkOverflowCast().

◆ safelyLT()

template<typename T , typename U >
constexpr bool mlir::sparse_tensor::detail::safelyLT ( t,
u 
)
constexprnoexcept

Definition at line 61 of file ArithmeticUtils.h.

Referenced by safelyGE(), and safelyGT().

◆ safelyNE()

template<typename T , typename U >
constexpr bool mlir::sparse_tensor::detail::safelyNE ( t,
u 
)
constexprnoexcept

Definition at line 56 of file ArithmeticUtils.h.

References safelyEQ().

◆ stageWithSortImpl()

LogicalResult mlir::sparse_tensor::detail::stageWithSortImpl ( sparse_tensor::StageWithSortSparseOp  op,
PatternRewriter rewriter,
Value tmpBufs 
)

Variable Documentation

◆ kInvalidId

constexpr unsigned mlir::sparse_tensor::detail::kInvalidId = -1u
staticconstexpr