My Project
Typedefs | Functions
mlir::edsc::ops Namespace Reference

Typedefs

using UnaryPointwiseOpBuilder = function_ref< Value(ValueHandle)>
 Unary pointwise operation (with broadcast) entry point. More...
 
using BinaryPointwiseOpBuilder = function_ref< Value(ValueHandle, ValueHandle)>
 Binary pointwise operation (with broadcast) entry point. More...
 

Functions

void macRegionBuilder (ArrayRef< BlockArgument > args)
 
Operationlinalg_pointwise (UnaryPointwiseOpBuilder unaryOp, StructuredIndexed I, StructuredIndexed O)
 
Operationlinalg_pointwise_tanh (StructuredIndexed I, StructuredIndexed O)
 
Operationlinalg_pointwise (BinaryPointwiseOpBuilder binaryOp, StructuredIndexed I1, StructuredIndexed I2, StructuredIndexed O)
 Binary pointwise operation (with broadcast) entry point. More...
 
Operationlinalg_pointwise_add (StructuredIndexed I1, StructuredIndexed I2, StructuredIndexed O)
 
Operationlinalg_pointwise_max (StructuredIndexed I1, StructuredIndexed I2, StructuredIndexed O)
 
Operationlinalg_matmul (ValueHandle vA, ValueHandle vB, ValueHandle vC)
 
template<typename Container >
Operationlinalg_matmul (Container values)
 
Operationlinalg_conv_nhwc (ValueHandle vI, ValueHandle vW, ValueHandle vO, ArrayRef< int > strides={}, ArrayRef< int > dilations={})
 
template<typename Container >
Operationlinalg_conv_nhwc (Container values, ArrayRef< int > strides={}, ArrayRef< int > dilations={})
 
Operationlinalg_dilated_conv_nhwc (ValueHandle vI, ValueHandle vW, ValueHandle vO, int depth_multiplier=1, ArrayRef< int > strides={}, ArrayRef< int > dilations={})
 
template<typename Container >
Operationlinalg_dilated_conv_nhwc (Container values, int depth_multiplier, ArrayRef< int > strides={}, ArrayRef< int > dilations={})
 

Typedef Documentation

◆ BinaryPointwiseOpBuilder

Binary pointwise operation (with broadcast) entry point.

◆ UnaryPointwiseOpBuilder

Unary pointwise operation (with broadcast) entry point.

TODO(ntv): In the future we should tie these implementations to something in Tablegen that generates the proper interfaces and the proper sugared named ops. Build a linalg.pointwise, under the current ScopedContext, at the current insert point, that computes:

(i0, ..., in) = (par, ..., par)
|
| O...(some_subset...(i0, ..., in)) =
| some_pointwise_func...(I...(some_other_subset...(i0, ..., in)))

This is a very generic entry point that can be configured in many ways to build a perfect loop nest of parallel loops with arbitrarily complex innermost loop code and whatever (explicit) broadcast semantics.

This can be used with both out-of-place and in-place semantics. The client is responsible for ensuring the region operations are compatible with in-place semantics and parallelism.

Function Documentation

◆ linalg_conv_nhwc() [1/2]

Operation * mlir::edsc::ops::linalg_conv_nhwc ( ValueHandle  vI,
ValueHandle  vW,
ValueHandle  vO,
ArrayRef< int >  strides = {},
ArrayRef< int >  dilations = {} 
)

Build a linalg.generic, under the current ScopedContext, at the current insert point, that computes:

(batch, f, [h, w, ...], [kh, kw, ...], c) =
| (par, par, [par, par, ...], [red, red, ...], red)
|
| O(batch, [h, w, ...], f) +=
| I(batch,
| [
| stride[0] * h + dilations[0] * kh,
| stride[1] * w + dilations[1] * kw, ...
],
| c)
| *
| W([kh, kw, ...], c, f)

If dilations or strides are left empty, the default value of 1 is used along each relevant dimension.

For now ... must be empty (i.e. only 2-D convolutions are supported).

◆ linalg_conv_nhwc() [2/2]

template<typename Container >
Operation* mlir::edsc::ops::linalg_conv_nhwc ( Container  values,
ArrayRef< int >  strides = {},
ArrayRef< int >  dilations = {} 
)

◆ linalg_dilated_conv_nhwc() [1/2]

Operation * mlir::edsc::ops::linalg_dilated_conv_nhwc ( ValueHandle  vI,
ValueHandle  vW,
ValueHandle  vO,
int  depth_multiplier = 1,
ArrayRef< int >  strides = {},
ArrayRef< int >  dilations = {} 
)

Build a linalg.generic, under the current ScopedContext, at the current insert point, that computes:

(batch, dm, c, [h, w, ...], [kh, kw, ...]) =
| (par, par, par, [par, par, ...], [red, red, ...])
|
| O(batch, [h, w, ...], c * depth_multiplier) +=
| I(batch,
| [
| stride[0] * h + dilations[0] * kh,
| stride[1] * w + dilations[1] * kw, ...
],
| c)
| *
| W([kh, kw, ...], c, depth_multiplier)

If dilations or strides are left empty, the default value of 1 is used along each relevant dimension.

For now ... must be empty (i.e. only 2-D convolutions are supported).

◆ linalg_dilated_conv_nhwc() [2/2]

template<typename Container >
Operation* mlir::edsc::ops::linalg_dilated_conv_nhwc ( Container  values,
int  depth_multiplier,
ArrayRef< int >  strides = {},
ArrayRef< int >  dilations = {} 
)

◆ linalg_matmul() [1/2]

Operation * mlir::edsc::ops::linalg_matmul ( ValueHandle  vA,
ValueHandle  vB,
ValueHandle  vC 
)

Build a linalg.generic, under the current ScopedContext, at the current insert point, that computes:

(m, n, k) = (par, par, seq)
|
| C(m, n) += A(m, k) * B(k, n)

◆ linalg_matmul() [2/2]

template<typename Container >
Operation* mlir::edsc::ops::linalg_matmul ( Container  values)

◆ linalg_pointwise() [1/2]

Operation * mlir::edsc::ops::linalg_pointwise ( UnaryPointwiseOpBuilder  unaryOp,
StructuredIndexed  I,
StructuredIndexed  O 
)

◆ linalg_pointwise() [2/2]

Operation * mlir::edsc::ops::linalg_pointwise ( BinaryPointwiseOpBuilder  binaryOp,
StructuredIndexed  I1,
StructuredIndexed  I2,
StructuredIndexed  O 
)

Binary pointwise operation (with broadcast) entry point.

◆ linalg_pointwise_add()

Operation * mlir::edsc::ops::linalg_pointwise_add ( StructuredIndexed  I1,
StructuredIndexed  I2,
StructuredIndexed  O 
)

Build a linalg.pointwise with all parallel iterators and a region that computes O = I1 + I2. The client is responsible for specifying the proper indexings when creating the StructuredIndexed.

◆ linalg_pointwise_max()

Operation * mlir::edsc::ops::linalg_pointwise_max ( StructuredIndexed  I1,
StructuredIndexed  I2,
StructuredIndexed  O 
)

Build a linalg.pointwise with all parallel iterators and a region that computes O = max(I!, I2). The client is responsible for specifying the proper indexings when creating the StructuredIndexed.

◆ linalg_pointwise_tanh()

Operation * mlir::edsc::ops::linalg_pointwise_tanh ( StructuredIndexed  I,
StructuredIndexed  O 
)

Build a linalg.pointwise with all parallel iterators and a region that computes O = tanh(I). The client is responsible for specifying the proper indexings when creating the StructuredIndexed.

◆ macRegionBuilder()

void mlir::edsc::ops::macRegionBuilder ( ArrayRef< BlockArgument args)

Build the body of a region to compute a multiply-accumulate, under the current ScopedContext, at the current insert point.