363 template<jit::
float_scalar T,
bool SAFE_MATH=false>
364 class leaf_node :
public std::enable_shared_from_this<leaf_node<T, SAFE_MATH>> {
371 std::map<size_t, std::shared_ptr<leaf_node<T, SAFE_MATH>>>
df_cache;
408 virtual std::shared_ptr<leaf_node>
reduce() = 0;
416 virtual std::shared_ptr<leaf_node<T, SAFE_MATH>>
458 virtual std::shared_ptr<leaf_node<T, SAFE_MATH>>
471 return this == x.get();
497 virtual void set(
const size_t index,
505 virtual void set(
const std::vector<T> &
d) {}
526 virtual std::shared_ptr<leaf_node<T, SAFE_MATH>>
to_vizgraph(std::stringstream &stream,
553 return this->
evaluate().is_normal();
637 virtual void endline(std::ostringstream &stream,
639#ifndef SHOW_USE_COUNT
645 <<
" // used " <<
usage.at(
this)
660 std::map<size_t, std::shared_ptr<leaf_node<T, SAFE_MATH>>>
nodes;
673 template<jit::
float_scalar T,
bool SAFE_MATH=false>
683 template<jit::
float_scalar T,
bool SAFE_MATH=false>
688 template<jit::
float_scalar T,
bool SAFE_MATH=false>
692 template<jit::
float_scalar T,
bool SAFE_MATH=false>
695 template<jit::
float_scalar T,
bool SAFE_MATH=false>
703 template<jit::
float_scalar T,
bool SAFE_MATH=false>
705 std::stringstream stream;
709 stream <<
"graph \"\" {" << std::endl;
710 stream <<
" node [fontname = \"Helvetica\", ordering = out]" << std::endl << std::endl;
711 node->to_vizgraph(stream, registers);
712 stream <<
"}" << std::endl;
714 std::cout << stream.str() << std::endl;
726 template<jit::
float_scalar T,
bool SAFE_MATH=false>
734 static std::string to_string(
const T
d) {
735 return jit::format_to_string<T> (
d);
750 assert(
d.size() == 1 &&
"Constants need to be scalar functions.");
797 if (registers.find(
this) == registers.end()) {
798#ifdef USE_CONSTANT_CACHE
801 jit::add_type<T> (stream);
804 stream <<
" " << registers[
this] <<
" = ";
806 jit::add_type<T> (stream);
812 registers[
this] = jit::get_type_string<T> () +
"("
816 registers[
this] =
"(" + jit::get_type_string<T> () +
")"
832 if (
this == x.get()) {
848 return data.
size() == 1 && data.
at(0) ==
d;
856 return std::imag(
temp) == 0 &&
864 std::cout << data.
at(0);
876 if (registers.find(
this) == registers.end()) {
878 registers[
this] =
name;
879 stream <<
" " <<
name
880 <<
" [label = \"" << this->
evaluate().at(0)
881 <<
"\", shape = box, style = \"rounded,filled\", fillcolor = black, fontcolor = white];" << std::endl;
951 template<jit::
float_scalar T,
bool SAFE_MATH=false>
953 auto temp = std::make_shared<constant_node<T, SAFE_MATH>> (
d);
964#if defined(__clang__) || defined(__GNUC__)
967 assert(
false &&
"Should never reach.");
980 template<jit::
float_scalar T,
bool SAFE_MATH=false>
994 template<jit::
float_scalar T,
bool SAFE_MATH>
1007 template<jit::
float_scalar T,
bool SAFE_MATH>
1020 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1026 template<jit::complex_scalar T>
1027 constexpr T
i = T(0.0, 1.0);
1030 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1042 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1044 return std::dynamic_pointer_cast<constant_node<T, SAFE_MATH>> (x);
1059 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1073 const std::string
s) :
1083 return this->arg->evaluate();
1105 this->arg->compile_preamble(stream, registers,
1110#ifdef SHOW_USE_COUNT
1132 return this->arg->compile(stream, registers,
indices,
usage);
1148 return this->arg->is_all_variables();
1173 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1192 const std::string
s) :
1208 const std::string
s,
1233 this->left->compile_preamble(stream, registers,
1237 this->right->compile_preamble(stream, registers,
1242#ifdef SHOW_USE_COUNT
1270 return this->left->is_all_variables() &&
1271 this->right->is_all_variables();
1279 virtual std::shared_ptr<leaf_node<T, SAFE_MATH>>
1297 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1316 const std::string
s) :
1345 this->
left->compile_preamble(stream, registers,
1349 this->middle->compile_preamble(stream, registers,
1353 this->
right->compile_preamble(stream, registers,
1358#ifdef SHOW_USE_COUNT
1379 return this->
left->is_all_variables() &&
1380 this->middle->is_all_variables() &&
1381 this->
right->is_all_variables();
1394 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1400 const std::string symbol;
1420 const std::string &symbol) :
1422 buffer(
s), symbol(symbol) {}
1432 const std::string &symbol) :
1434 buffer(
s,
d), symbol(symbol) {
1445 const std::string &symbol) :
1447 buffer(
d), symbol(symbol) {
1458 const std::string &symbol) :
1460 buffer(
d), symbol(symbol) {
1517#ifdef SHOW_USE_COUNT
1556 virtual void set(
const size_t index,
const T
d) {
1565 virtual void set(
const std::vector<T> &
d) {
1601 if (registers.find(
this) == registers.end()) {
1603 registers[
this] =
name;
1604 stream <<
" " <<
name
1606 <<
"\", shape = box];" << std::endl;
1616 return buffer.
size();
1625 return buffer.
data();
1674 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1676 const std::string &symbol) {
1677 return std::make_shared<variable_node<T, SAFE_MATH>> (
s, symbol);
1690 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1692 const std::string &symbol) {
1693 return std::make_shared<variable_node<T, SAFE_MATH>> (
s,
d, symbol);
1705 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1707 const std::string &symbol) {
1708 return std::make_shared<variable_node<T, SAFE_MATH>> (
d, symbol);
1720 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1722 const std::string &symbol) {
1723 return std::make_shared<variable_node<T, SAFE_MATH>> (
d, symbol);
1727 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1730 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1733 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1734 using map_nodes = std::vector<std::pair<shared_leaf<T, SAFE_MATH>,
1746 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1748 return std::dynamic_pointer_cast<variable_node<T, SAFE_MATH>> (x);
1764 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1811 std::cout <<
"\\left(";
1812 this->
arg->to_latex();
1813 std::cout <<
"\\right)";
1840 return this->
arg->get_power_base();
1849 return this->
arg->get_power_exponent();
1879 if (registers.find(
this) == registers.end()) {
1881 registers[
this] =
name;
1882 stream <<
" " <<
name
1883 <<
" [label = \"pseudo_variable\", shape = oval, style = filled, fillcolor = blue, fontcolor = white];" << std::endl;
1885 auto a = this->
arg->to_vizgraph(stream, registers);
1886 stream <<
" " <<
name <<
" -- " << registers[
a.get()] <<
";" << std::endl;
1902 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1904 return std::make_shared<pseudo_variable_node<T, SAFE_MATH>> (x);
1908 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1920 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1922 return std::dynamic_pointer_cast<pseudo_variable_node<T, SAFE_MATH>> (x);
Class signature to implement compute backends.
Class representing a generic buffer.
Definition backend.hpp:29
bool is_normal() const
Check for normal values.
Definition backend.hpp:279
const T at(const size_t index) const
Get value at.
Definition backend.hpp:91
bool has_zero() const
Is any element zero.
Definition backend.hpp:156
size_t size() const
Get size of the buffer.
Definition backend.hpp:116
void set(const T d)
Assign a constant value.
Definition backend.hpp:100
T * data()
Get a pointer to the basic memory buffer.
Definition backend.hpp:270
Class representing a branch node.
Definition node.hpp:1174
shared_leaf< T, SAFE_MATH > get_left()
Get the left branch.
Definition node.hpp:1253
virtual bool is_all_variables() const
Test if node acts like a variable.
Definition node.hpp:1269
virtual void compile_preamble(std::ostringstream &stream, jit::register_map ®isters, jit::visiter_map &visited, jit::register_usage &usage, jit::texture1d_list &textures1d, jit::texture2d_list &textures2d, int &avail_const_mem)
Compile preamble.
Definition node.hpp:1225
branch_node(shared_leaf< T, SAFE_MATH > l, shared_leaf< T, SAFE_MATH > r, const std::string s, const size_t count, const bool pseudo)
Assigns the left and right branches.
Definition node.hpp:1206
shared_leaf< T, SAFE_MATH > get_right()
Get the right branch.
Definition node.hpp:1260
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > get_power_exponent() const
Get the exponent of a power.
Definition node.hpp:1280
branch_node(shared_leaf< T, SAFE_MATH > l, shared_leaf< T, SAFE_MATH > r, const std::string s)
Assigns the left and right branches.
Definition node.hpp:1190
shared_leaf< T, SAFE_MATH > right
Right branch of the tree.
Definition node.hpp:1179
shared_leaf< T, SAFE_MATH > left
Left branch of the tree.
Definition node.hpp:1177
Class representing data that cannot change.
Definition node.hpp:727
virtual shared_leaf< T, SAFE_MATH > get_power_exponent() const
Get the exponent of a power.
Definition node.hpp:937
virtual void to_latex() const
Convert the node to latex.
Definition node.hpp:863
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition node.hpp:793
virtual shared_leaf< T, SAFE_MATH > get_power_base()
Get the base of a power.
Definition node.hpp:928
bool is(const T d)
Check if the constant is value.
Definition node.hpp:847
virtual backend::buffer< T > evaluate()
Evaluate method.
Definition node.hpp:758
virtual bool is_all_variables() const
Test if node acts like a variable.
Definition node.hpp:910
virtual bool is_match(shared_leaf< T, SAFE_MATH > x)
Query if the nodes match.
Definition node.hpp:831
constant_node(const backend::buffer< T > &d)
Construct a constant node from a vector.
Definition node.hpp:748
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition node.hpp:874
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition node.hpp:779
virtual bool is_constant() const
Test if node is a constant.
Definition node.hpp:892
virtual bool has_constant_zero() const
Test the constant node has a zero.
Definition node.hpp:901
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduction method.
Definition node.hpp:769
bool is_integer()
Check if the value is an integer.
Definition node.hpp:854
virtual bool is_power_like() const
Test if the node acts like a power of variable.
Definition node.hpp:919
Class representing a node leaf.
Definition node.hpp:364
virtual ~leaf_node()
Destructor.
Definition node.hpp:392
virtual void endline(std::ostringstream &stream, const jit::register_usage &usage) const final
End a line in the kernel source.
Definition node.hpp:637
virtual void set(const std::vector< T > &d)
Set the value of variable data.
Definition node.hpp:505
virtual bool is_power_like() const
Test if the node acts like a power of variable.
Definition node.hpp:570
virtual bool is_match(std::shared_ptr< leaf_node< T, SAFE_MATH > > x)
Query if the nodes match.
Definition node.hpp:470
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)=0
Compile the node.
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > get_power_exponent() const =0
Get the exponent of a power.
virtual void to_latex() const =0
Convert the node to latex.
T base
Type def to retrieve the backend type.
Definition node.hpp:669
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > df(std::shared_ptr< leaf_node< T, SAFE_MATH > > x)=0
Transform node to derivative.
const bool contains_pseudo
Node contains pseudo variables.
Definition node.hpp:373
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > remove_pseudo()
Remove pseudo variable nodes.
Definition node.hpp:627
virtual void set(const backend::buffer< T > &d)
Set the value of variable data.
Definition node.hpp:512
static thread_local caches_t caches
A per thread instance of the cache structure.
Definition node.hpp:666
virtual bool is_constant() const
Test if node is a constant.
Definition node.hpp:534
virtual void set(const size_t index, const T d)
Set the value of variable data.
Definition node.hpp:497
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)=0
Convert the node to vizgraph.
virtual std::shared_ptr< leaf_node< T, SAFE_MATH > > get_power_base()
Get the base of a power.
Definition node.hpp:581
leaf_node(const std::string s, const size_t count, const bool pseudo)
Construct a basic node.
Definition node.hpp:383
virtual bool has_constant_zero() const
Test the constant node has a zero.
Definition node.hpp:543
virtual void set(const T d)
Set the value of variable data.
Definition node.hpp:489
const size_t complexity
Graph complexity.
Definition node.hpp:369
virtual backend::buffer< T > evaluate()=0
Evaluate method.
std::map< size_t, std::shared_ptr< leaf_node< T, SAFE_MATH > > > df_cache
Cache derivative terms.
Definition node.hpp:371
bool is_power_base_match(std::shared_ptr< leaf_node< T, SAFE_MATH > > x)
Check if the base of the powers match.
Definition node.hpp:480
virtual bool is_all_variables() const =0
Test if all the sub-nodes terminate in variables.
virtual std::shared_ptr< leaf_node > reduce()=0
Reduction method.
size_t get_complexity() const
Get the number of nodes in the subgraph.
Definition node.hpp:609
virtual bool has_pseudo() const
Query if the node contains pseudo variables.
Definition node.hpp:618
const size_t hash
Hash for node.
Definition node.hpp:367
virtual void compile_preamble(std::ostringstream &stream, jit::register_map ®isters, jit::visiter_map &visited, jit::register_usage &usage, jit::texture1d_list &textures1d, jit::texture2d_list &textures2d, int &avail_const_mem)
Compile preamble.
Definition node.hpp:433
bool is_normal()
Test if the result is normal.
Definition node.hpp:552
size_t get_hash() const
Get the hash for the node.
Definition node.hpp:600
Class representing a subexpression that acts like a variable.
Definition node.hpp:1765
virtual void to_latex() const
Convert the node to latex.
Definition node.hpp:1810
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition node.hpp:1803
virtual bool is_power_like() const
Test if the node acts like a power of variable.
Definition node.hpp:1830
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition node.hpp:1877
virtual shared_leaf< T, SAFE_MATH > get_power_exponent() const
Get the exponent of a power.
Definition node.hpp:1848
virtual bool is_all_variables() const
Test if node acts like a variable.
Definition node.hpp:1821
virtual shared_leaf< T, SAFE_MATH > remove_pseudo()
Remove pseudo variable nodes.
Definition node.hpp:1866
virtual shared_leaf< T, SAFE_MATH > get_power_base()
Get the base of a power.
Definition node.hpp:1839
virtual bool has_pseudo() const
Query if the node contains pseudo variables.
Definition node.hpp:1857
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduction method.
Definition node.hpp:1793
pseudo_variable_node(shared_leaf< T, SAFE_MATH > a)
Construct a pseudo variable node.
Definition node.hpp:1783
Class representing a straight node.
Definition node.hpp:1060
virtual shared_leaf< T, SAFE_MATH > get_power_exponent() const
Get the exponent of a power.
Definition node.hpp:1156
shared_leaf< T, SAFE_MATH > arg
Argument.
Definition node.hpp:1063
virtual backend::buffer< T > evaluate()
Evaluate method.
Definition node.hpp:1082
shared_leaf< T, SAFE_MATH > get_arg()
Get the argument.
Definition node.hpp:1138
virtual void compile_preamble(std::ostringstream &stream, jit::register_map ®isters, jit::visiter_map &visited, jit::register_usage &usage, jit::texture1d_list &textures1d, jit::texture2d_list &textures2d, int &avail_const_mem)
Compile preamble.
Definition node.hpp:1097
straight_node(shared_leaf< T, SAFE_MATH > a, const std::string s)
Construct a straight node.
Definition node.hpp:1072
virtual bool is_all_variables() const
Test if node acts like a variable.
Definition node.hpp:1147
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition node.hpp:1128
Class representing a triple branch node.
Definition node.hpp:1298
virtual void compile_preamble(std::ostringstream &stream, jit::register_map ®isters, jit::visiter_map &visited, jit::register_usage &usage, jit::texture1d_list &textures1d, jit::texture2d_list &textures2d, int &avail_const_mem)
Compile preamble.
Definition node.hpp:1337
shared_leaf< T, SAFE_MATH > get_middle()
Get the right branch.
Definition node.hpp:1369
virtual bool is_all_variables() const
Test if node acts like a variable.
Definition node.hpp:1378
triple_node(shared_leaf< T, SAFE_MATH > l, shared_leaf< T, SAFE_MATH > m, shared_leaf< T, SAFE_MATH > r, const std::string s)
Reduces and assigns the left and right branches.
Definition node.hpp:1313
shared_leaf< T, SAFE_MATH > middle
Middle branch of the tree.
Definition node.hpp:1301
Class representing data that can change.
Definition node.hpp:1395
virtual shared_leaf< T, SAFE_MATH > get_power_base()
Get the base of a power.
Definition node.hpp:1651
variable_node(const backend::buffer< T > &d, const std::string &symbol)
Construct a variable node from backend buffer.
Definition node.hpp:1457
virtual bool is_all_variables() const
Test if node acts like a variable.
Definition node.hpp:1633
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition node.hpp:1490
variable_node(const size_t s, const T d, const std::string &symbol)
Construct a variable node from a scalar.
Definition node.hpp:1431
virtual void to_latex() const
Convert the node to latex.
Definition node.hpp:1588
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduction method.
Definition node.hpp:1480
size_t size()
Get the size of the variable buffer.
Definition node.hpp:1615
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition node.hpp:1534
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition node.hpp:1599
virtual void compile_preamble(std::ostringstream &stream, jit::register_map ®isters, jit::visiter_map &visited, jit::register_usage &usage, jit::texture1d_list &textures1d, jit::texture2d_list &textures2d, int &avail_const_mem)
Compile preamble.
Definition node.hpp:1508
virtual backend::buffer< T > evaluate()
Evaluate method.
Definition node.hpp:1469
T * data()
Get a pointer to raw buffer.
Definition node.hpp:1624
virtual void set(const T d)
Set the value of variable data.
Definition node.hpp:1546
virtual bool is_power_like() const
Test if the node acts like a power of variable.
Definition node.hpp:1642
virtual void set(const backend::buffer< T > &d)
Set the value of variable data.
Definition node.hpp:1574
virtual void set(const size_t index, const T d)
Set the value of variable data.
Definition node.hpp:1556
variable_node(const size_t s, const std::string &symbol)
Construct a variable node with a size.
Definition node.hpp:1419
virtual void set(const std::vector< T > &d)
Set the value of variable data.
Definition node.hpp:1565
variable_node(const std::vector< T > &d, const std::string &symbol)
Construct a variable node from a vector.
Definition node.hpp:1444
std::string get_symbol() const
Get Symbol.
Definition node.hpp:1581
virtual shared_leaf< T, SAFE_MATH > get_power_exponent() const
Get the exponent of a power.
Definition node.hpp:1660
Complex scalar concept.
Definition register.hpp:24
subroutine assert(test, message)
Assert check.
Definition f_binding_test.f90:38
Name space for graph nodes.
Definition arithmetic.hpp:13
constexpr shared_leaf< T, SAFE_MATH > zero()
Forward declare for zero.
Definition node.hpp:995
std::shared_ptr< variable_node< T, SAFE_MATH > > shared_variable
Convenience type alias for shared variable nodes.
Definition node.hpp:1728
constexpr shared_leaf< T, SAFE_MATH > none()
Create a one constant.
Definition node.hpp:1021
void make_vizgraph(shared_leaf< T, SAFE_MATH > node)
Build the vizgraph input.
Definition node.hpp:704
constexpr shared_leaf< T, SAFE_MATH > one()
Forward declare for one.
Definition node.hpp:1008
std::vector< shared_variable< T, SAFE_MATH > > input_nodes
Convenience type alias for a vector of inputs.
Definition node.hpp:1731
shared_constant< T, SAFE_MATH > constant_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a constant node.
Definition node.hpp:1043
shared_variable< T, SAFE_MATH > variable_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a variable node.
Definition node.hpp:1747
constexpr T i
Convenience type for imaginary constant.
Definition node.hpp:1027
shared_leaf< T, SAFE_MATH > constant(const backend::buffer< T > &d)
Construct a constant.
Definition node.hpp:952
shared_leaf< T, SAFE_MATH > variable(const size_t s, const std::string &symbol)
Construct a variable.
Definition node.hpp:1675
std::shared_ptr< pseudo_variable_node< T, SAFE_MATH > > shared_pseudo_variable
Convenience type alias for shared pseudo variable nodes.
Definition node.hpp:1909
std::shared_ptr< leaf_node< T, SAFE_MATH > > shared_leaf
Convenience type alias for shared leaf nodes.
Definition node.hpp:674
std::vector< std::pair< shared_leaf< T, SAFE_MATH >, shared_variable< T, SAFE_MATH > > > map_nodes
Convenience type alias for mapping end codes back to inputs.
Definition node.hpp:1735
constexpr shared_leaf< T, SAFE_MATH > null_leaf()
Create a null leaf.
Definition node.hpp:684
std::shared_ptr< constant_node< T, SAFE_MATH > > shared_constant
Convenience type alias for shared constant nodes.
Definition node.hpp:1031
std::vector< shared_leaf< T, SAFE_MATH > > output_nodes
Convenience type alias for a vector of output nodes.
Definition node.hpp:689
shared_leaf< T, SAFE_MATH > pseudo_variable(shared_leaf< T, SAFE_MATH > x)
Define pseudo variable convenience function.
Definition node.hpp:1903
shared_pseudo_variable< T, SAFE_MATH > pseudo_variable_cast(shared_leaf< T, SAFE_MATH > &x)
Cast to a pseudo variable node.
Definition node.hpp:1921
std::map< void *, size_t > texture1d_list
Type alias for indexing 1D textures.
Definition register.hpp:263
std::string format_to_string(const T value)
Convert a value to a string while avoiding locale.
Definition register.hpp:212
std::map< void *, std::array< size_t, 2 > > texture2d_list
Type alias for indexing 2D textures.
Definition register.hpp:265
std::map< void *, size_t > register_usage
Type alias for counting register usage.
Definition register.hpp:259
std::map< void *, std::string > register_map
Type alias for mapping node pointers to register names.
Definition register.hpp:257
std::set< void * > visiter_map
Type alias for listing visited nodes.
Definition register.hpp:261
std::string to_string(const char prefix, const NODE *pointer)
Convert a graph::leaf_node pointer to a string.
Definition register.hpp:246
Data structure to contain the two caches.
Definition node.hpp:658
std::map< size_t, std::shared_ptr< leaf_node< T, SAFE_MATH > > > nodes
Cache of node.
Definition node.hpp:660
std::map< size_t, backend::buffer< T > > backends
Cache of backend buffers.
Definition node.hpp:662