ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
Loading...
Searching...
No Matches
ember_ir::expr::Expr Class Reference

#include <graph_ir_expr.h>

Collaboration diagram for ember_ir::expr::Expr:
Collaboration graph

Public Member Functions

const std::string & text () const
 
size_t n_inputs () const
 
const Node & root () const
 

Static Public Member Functions

static Expr parse (const std::string &text, size_t n_inputs=1)
 

Static Public Attributes

static constexpr size_t kMaxInputs = 23
 
static constexpr size_t kMaxDepth = 200
 

Private Attributes

std::string text_
 
size_t n_inputs_ = 1
 
Node root_
 

Detailed Description

Definition at line 38 of file graph_ir_expr.h.

Member Function Documentation

◆ n_inputs()

size_t ember_ir::expr::Expr::n_inputs ( ) const
inline

Definition at line 48 of file graph_ir_expr.h.

48{ return n_inputs_; }

References n_inputs_.

Referenced by parse().

◆ parse()

Expr ember_ir::expr::Expr::parse ( const std::string &  text,
size_t  n_inputs = 1 
)
static

Definition at line 511 of file graph_ir_expr.cpp.

511 {
512 if (n_inputs == 0 || n_inputs > kMaxInputs)
513 throw std::invalid_argument("expr: " + std::to_string(n_inputs) + " inputs (1 to " + std::to_string(kMaxInputs) +
514 ")");
515 Expr e;
516 e.text_ = text;
517 e.n_inputs_ = n_inputs;
518 e.root_ = Parser(e.text_, n_inputs).parse();
519 return e;
520}
size_t n_inputs() const
static constexpr size_t kMaxInputs
const std::string & text() const
size_t j

References j, kMaxInputs, n_inputs(), text(), and text_.

Referenced by ember_ir::expr::cached().

◆ root()

const Node & ember_ir::expr::Expr::root ( ) const
inline

Definition at line 49 of file graph_ir_expr.h.

49{ return root_; }

References root_.

◆ text()

const std::string & ember_ir::expr::Expr::text ( ) const
inline

Definition at line 47 of file graph_ir_expr.h.

47{ return text_; }

References text_.

Referenced by parse().

Member Data Documentation

◆ kMaxDepth

constexpr size_t ember_ir::expr::Expr::kMaxDepth = 200
staticconstexpr

Definition at line 41 of file graph_ir_expr.h.

◆ kMaxInputs

constexpr size_t ember_ir::expr::Expr::kMaxInputs = 23
staticconstexpr

Definition at line 40 of file graph_ir_expr.h.

Referenced by ember_ir::ir_expr_cuda(), and parse().

◆ n_inputs_

size_t ember_ir::expr::Expr::n_inputs_ = 1
private

Definition at line 53 of file graph_ir_expr.h.

Referenced by n_inputs().

◆ root_

Node ember_ir::expr::Expr::root_
private

Definition at line 54 of file graph_ir_expr.h.

Referenced by root().

◆ text_

std::string ember_ir::expr::Expr::text_
private

Definition at line 52 of file graph_ir_expr.h.

Referenced by parse(), and text().


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