MLIR 24.0.0git
XeGPUUtils.cpp File Reference

Go to the source code of this file.

Functions

xegpu::DistributeLayoutAttr maybePickPermanentLayout (xegpu::DistributeLayoutAttr layout, const OpResult &result, mlir::Operation *owner, const std::string &name)
xegpu::DistributeLayoutAttr maybePickPermanentLayout (xegpu::DistributeLayoutAttr layout, const OpOperand &operand, mlir::Operation *owner, const std::string &name)
template xegpu::DistributeLayoutAttr xegpu::getTemporaryLayout< mlir::OpResult > (const OpResult &result)
template xegpu::DistributeLayoutAttr xegpu::getTemporaryLayout< mlir::OpOperand > (const OpOperand &operand)
template void xegpu::setTemporaryLayout< mlir::OpResult > (const mlir::OpResult &result, const mlir::xegpu::DistributeLayoutAttr layout)
template void xegpu::setTemporaryLayout< mlir::OpOperand > (const mlir::OpOperand &operand, const mlir::xegpu::DistributeLayoutAttr layout)
static arith::FastMathFlags getFlags (arith::FastMathFlagsAttr fastmath)
 Returns the flags held by fastmath, or none if it is null.
static APFloat getMinMaxNeutral (const llvm::fltSemantics &semantics, vector::CombiningKind kind, arith::FastMathFlags flags)
 Returns the neutral value of the float min or max reduction kind over elements of semantics.

Function Documentation

◆ getFlags()

arith::FastMathFlags getFlags ( arith::FastMathFlagsAttr fastmath)
static

Returns the flags held by fastmath, or none if it is null.

Definition at line 569 of file XeGPUUtils.cpp.

Referenced by mlir::xegpu::createReductionNeutralValue(), mlir::xegpu::lowerToVectorReductions(), and mlir::xegpu::subgroupReduction().

◆ getMinMaxNeutral()

APFloat getMinMaxNeutral ( const llvm::fltSemantics & semantics,
vector::CombiningKind kind,
arith::FastMathFlags flags )
static

Returns the neutral value of the float min or max reduction kind over elements of semantics.

The reduction combines this value under its fast-math flags, so build only a value that the format can represent and the flags allow:

  • A kind that ignores NaN operands uses a quiet NaN, if the format has one and nnan is not set.
  • Otherwise it uses the infinity that never wins, if the format has one and ninf is not set.
  • Otherwise it uses the lowest (for max) or highest (for min) finite value. That value never wins either: no number that the format and the flags allow is below the lowest or above the highest finite value.

Definition at line 749 of file XeGPUUtils.cpp.

Referenced by mlir::xegpu::createReductionNeutralValue().

◆ maybePickPermanentLayout() [1/2]

xegpu::DistributeLayoutAttr maybePickPermanentLayout ( xegpu::DistributeLayoutAttr layout,
const OpOperand & operand,
mlir::Operation * owner,
const std::string & name )

Definition at line 284 of file XeGPUUtils.cpp.

◆ maybePickPermanentLayout() [2/2]

xegpu::DistributeLayoutAttr maybePickPermanentLayout ( xegpu::DistributeLayoutAttr layout,
const OpResult & result,
mlir::Operation * owner,
const std::string & name )

Definition at line 268 of file XeGPUUtils.cpp.

References result.

◆ xegpu::getTemporaryLayout< mlir::OpOperand >()

template xegpu::DistributeLayoutAttr xegpu::getTemporaryLayout< mlir::OpOperand > ( const OpOperand & operand)

◆ xegpu::getTemporaryLayout< mlir::OpResult >()

template xegpu::DistributeLayoutAttr xegpu::getTemporaryLayout< mlir::OpResult > ( const OpResult & result)

◆ xegpu::setTemporaryLayout< mlir::OpOperand >()

template void xegpu::setTemporaryLayout< mlir::OpOperand > ( const mlir::OpOperand & operand,
const mlir::xegpu::DistributeLayoutAttr layout )

◆ xegpu::setTemporaryLayout< mlir::OpResult >()

template void xegpu::setTemporaryLayout< mlir::OpResult > ( const mlir::OpResult & result,
const mlir::xegpu::DistributeLayoutAttr layout )