docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::fp_math::KernelBuilder Class Reference

Builds loop nests over transient buffers into a sequence. More...

#include <sdfg/fp_math/contractions/kernel_builder.h>

Public Member Functions

 KernelBuilder (builder::StructuredSDFGBuilder &builder, structured_control_flow::Sequence &scope, DebugInfo debug_info)
builder::StructuredSDFGBuilder & builder ()
structured_control_flow::Sequence & scope ()
const DebugInfo & debug_info () const
std::string scalar (const std::string &prefix, types::PrimitiveType type)
 A new transient scalar.
std::string buffer (const std::string &prefix, types::PrimitiveType type, const symbolic::Expression &count)
 A new transient buffer of count elements, allocated in the scope right away.
structured_control_flow::StructuredLoop & map (structured_control_flow::Sequence &scope, const std::string &prefix, const symbolic::Expression &bound)
 A sequential map counting from zero up to bound in scope.
structured_control_flow::StructuredLoop & for_loop (structured_control_flow::Sequence &scope, const std::string &prefix, const symbolic::Expression &bound)
 A for loop counting from zero up to bound in scope.
structured_control_flow::StructuredLoop & reduce (structured_control_flow::Sequence &scope, const std::string &prefix, const symbolic::Expression &bound, structured_control_flow::ReductionOperation operation, const std::string &accumulator)
 A reduction counting from zero up to bound in scope, combining into accumulator with operation.
BlockBuilder block (structured_control_flow::Sequence &scope)
void finish ()
 Frees all buffers at the end of the scope.

Detailed Description

Builds loop nests over transient buffers into a sequence.

Buffers are allocated where they are requested, in order, and freed by finish().

Constructor & Destructor Documentation

◆ KernelBuilder()

sdfg::fp_math::KernelBuilder::KernelBuilder ( builder::StructuredSDFGBuilder & builder,
structured_control_flow::Sequence & scope,
DebugInfo debug_info )

Member Function Documentation

◆ block()

BlockBuilder sdfg::fp_math::KernelBuilder::block ( structured_control_flow::Sequence & scope)

◆ buffer()

std::string sdfg::fp_math::KernelBuilder::buffer ( const std::string & prefix,
types::PrimitiveType type,
const symbolic::Expression & count )

A new transient buffer of count elements, allocated in the scope right away.

◆ builder()

builder::StructuredSDFGBuilder & sdfg::fp_math::KernelBuilder::builder ( )
inline

◆ debug_info()

const DebugInfo & sdfg::fp_math::KernelBuilder::debug_info ( ) const
inline

◆ finish()

void sdfg::fp_math::KernelBuilder::finish ( )

Frees all buffers at the end of the scope.

◆ for_loop()

structured_control_flow::StructuredLoop & sdfg::fp_math::KernelBuilder::for_loop ( structured_control_flow::Sequence & scope,
const std::string & prefix,
const symbolic::Expression & bound )

A for loop counting from zero up to bound in scope.

◆ map()

structured_control_flow::StructuredLoop & sdfg::fp_math::KernelBuilder::map ( structured_control_flow::Sequence & scope,
const std::string & prefix,
const symbolic::Expression & bound )

A sequential map counting from zero up to bound in scope.

◆ reduce()

structured_control_flow::StructuredLoop & sdfg::fp_math::KernelBuilder::reduce ( structured_control_flow::Sequence & scope,
const std::string & prefix,
const symbolic::Expression & bound,
structured_control_flow::ReductionOperation operation,
const std::string & accumulator )

A reduction counting from zero up to bound in scope, combining into accumulator with operation.

◆ scalar()

std::string sdfg::fp_math::KernelBuilder::scalar ( const std::string & prefix,
types::PrimitiveType type )

A new transient scalar.

◆ scope()

structured_control_flow::Sequence & sdfg::fp_math::KernelBuilder::scope ( )
inline

The documentation for this class was generated from the following file: