My Project
Classes | Functions
mlir::functional Namespace Reference

Classes

struct  ScopeGuard
 Simple ScopeGuard. More...
 

Functions

template<typename Fn , typename IterType >
auto map (Fn fun, IterType begin, IterType end) -> SmallVector< typename std::result_of< Fn(decltype(*begin))>::type, 8 >
 Map with iterators. More...
 
template<typename Fn , typename ContainerType >
auto map (Fn fun, ContainerType input) -> decltype(map(fun, std::begin(input), std::end(input)))
 Map with templated container. More...
 
template<typename Fn , typename ContainerType1 , typename ContainerType2 >
auto zipMap (Fn fun, ContainerType1 input1, ContainerType2 input2) -> SmallVector< typename std::result_of< Fn(decltype(*input1.begin()), decltype(*input2.begin()))>::type, 8 >
 
template<typename Fn , typename IterType >
void apply (Fn fun, IterType begin, IterType end)
 Apply with iterators. More...
 
template<typename Fn , typename ContainerType >
void apply (Fn fun, ContainerType input)
 Apply with templated container. More...
 
template<typename Fn , typename ContainerType1 , typename ContainerType2 >
void zipApply (Fn fun, ContainerType1 input1, ContainerType2 input2)
 
template<typename T , typename ToType = T>
std::function< ToType *(T *)> makePtrDynCaster ()
 

Function Documentation

◆ apply() [1/2]

template<typename Fn , typename IterType >
void mlir::functional::apply ( Fn  fun,
IterType  begin,
IterType  end 
)

Apply with iterators.

◆ apply() [2/2]

template<typename Fn , typename ContainerType >
void mlir::functional::apply ( Fn  fun,
ContainerType  input 
)

Apply with templated container.

◆ makePtrDynCaster()

template<typename T , typename ToType = T>
std::function<ToType *(T *)> mlir::functional::makePtrDynCaster ( )
inline

Unwraps a pointer type to another type (possibly the same). Used in particular to allow easier compositions of Operation::operand_range types.

◆ map() [1/2]

template<typename Fn , typename IterType >
auto mlir::functional::map ( Fn  fun,
IterType  begin,
IterType  end 
) -> SmallVector<typename std::result_of<Fn(decltype(*begin))>::type, 8>

Map with iterators.

◆ map() [2/2]

template<typename Fn , typename ContainerType >
auto mlir::functional::map ( Fn  fun,
ContainerType  input 
) -> decltype(map(fun, std::begin(input), std::end(input)))

Map with templated container.

◆ zipApply()

template<typename Fn , typename ContainerType1 , typename ContainerType2 >
void mlir::functional::zipApply ( Fn  fun,
ContainerType1  input1,
ContainerType2  input2 
)

Zip apply with 2 templated container, iterates to the min of the sizes of the 2 containers. TODO(ntv): make variadic when needed.

◆ zipMap()

template<typename Fn , typename ContainerType1 , typename ContainerType2 >
auto mlir::functional::zipMap ( Fn  fun,
ContainerType1  input1,
ContainerType2  input2 
) -> SmallVector<typename std::result_of<Fn(decltype(*input1.begin()), decltype(*input2.begin()))>::type, 8>

Zip map with 2 templated container, iterates to the min of the sizes of the 2 containers. TODO(ntv): make variadic when needed.