9 #include "ade/traveler.hpp" 11 #include "llo/generated/opmap.hpp" 31 void visit (ade::iLeaf* leaf)
override 33 const char* data = (
const char*) leaf->data();
34 age::_GENERATED_DTYPE dtype = (age::_GENERATED_DTYPE) leaf->type_code();
35 const ade::Shape& shape = leaf->shape();
41 void visit (ade::iFunctor* func)
override 43 age::_GENERATED_OPCODE opcode = (age::_GENERATED_OPCODE)
44 func->get_opcode().code_;
47 ade::ArgsT children = func->get_children();
48 uint8_t nargs = children.size();
50 if (func->get_opcode().code_ == age::RAND_BINO)
54 logs::fatalf(
"cannot RAND_BINO without exactly 2 arguments: " 55 "using %d arguments", nargs);
58 children[0].get_tensor()->accept(left_eval);
62 children[0].get_coorder(),
67 children[1].get_tensor()->accept(right_eval);
71 children[1].get_coorder(),
77 for (uint8_t i = 0; i < nargs; ++i)
80 children[i].get_tensor()->accept(evaler);
84 children[i].get_coorder(),
106 #endif // LLO_EVAL_HPP std::vector< DataArg > DataArgsT
Vector of DataArgs to hold arguments.
Definition: data.hpp:241
void copyover(const char *indata, age::_GENERATED_DTYPE intype)
Data to pass around when evaluating.
Definition: data.hpp:224
ade::Shape shape_
Shape of data_.
Definition: data.hpp:38
GenericData out_
Output data evaluated upon visiting node.
Definition: eval.hpp:94
void visit(ade::iLeaf *leaf) override
Implementation of iTraveler.
Definition: eval.hpp:31
Evaluator(age::_GENERATED_DTYPE dtype)
Definition: eval.hpp:28
GenericData eval(ade::TensptrT tens, age::_GENERATED_DTYPE dtype)
Evaluate generic data of tens converted to specified dtype.
GenericData for holding data when passing up the tensor graph.
Definition: data.hpp:24
age::_GENERATED_DTYPE dtype_
Type encoding of data_.
Definition: data.hpp:41
age::_GENERATED_DTYPE dtype_
Output type when evaluating data.
Definition: eval.hpp:98
std::shared_ptr< char > data_
Smartpointer to a block of untyped data.
Definition: data.hpp:35
void visit(ade::iFunctor *func) override
Implementation of iTraveler.
Definition: eval.hpp:41