Graph Framework
Loading...
Searching...
No Matches
jit Namespace Reference

Name space for JIT functions. More...

Classes

class  context
 Class for JIT compile of the GPU kernels. More...
 
class  float_compare
 Define a custom comparitor class. More...
 

Concepts

concept  complex_scalar
 Complex scalar concept.
 
concept  float_scalar
 Float scalar concept.
 
concept  scalar
 General scalar concept.
 
concept  float_base
 float base concept.
 
concept  double_base
 Double base concept.
 

Typedefs

typedef std::map< void *, std::string > register_map
 Type alias for mapping node pointers to register names.
 
typedef std::map< void *, size_t > register_usage
 Type alias for counting register usage.
 
typedef std::set< void * > visiter_map
 Type alias for listing visited nodes.
 
typedef std::map< void *, size_t > texture1d_list
 Type alias for indexing 1D textures.
 
typedef std::map< void *, std::array< size_t, 2 > > texture2d_list
 Type alias for indexing 2D textures.
 

Functions

template<float_scalar T>
std::string type_to_string ()
 Convert a base type to a string.
 
constexpr bool use_cuda ()
 Test to use Cuda.
 
template<float_scalar T>
constexpr bool use_metal ()
 Test to use metal.
 
template<float_scalar T>
constexpr bool use_gpu ()
 Test to use the GPU.
 
template<float_scalar T>
std::string smallest_int_type (const size_t max_size)
 Get smallest integer type.
 
template<float_scalar T>
std::string get_type_string ()
 Get the type string.
 
template<float_scalar T>
void add_type (std::basic_ostream< char > &stream)
 Write out the node base type to a general stream.
 
template<float_scalar T>
constexpr int max_digits10 ()
 The maximum number of digits to represent a type literal.
 
template<float_scalar T>
constexpr int max_base ()
 The maximum value for a base type.
 
template<scalar T>
std::string format_to_string (const T value)
 Convert a value to a string while avoiding locale.
 
template<class NODE >
std::string to_string (const char prefix, const NODE *pointer)
 Convert a graph::leaf_node pointer to a string.
 

Detailed Description

Name space for JIT functions.

Function Documentation

◆ add_type()

template<float_scalar T>
void jit::add_type ( std::basic_ostream< char > &  stream)

Write out the node base type to a general stream.

Template Parameters
TBase type of the calculation.
Parameters
[in,out]streamGeneric stream.

◆ format_to_string()

template<scalar T>
std::string jit::format_to_string ( const T  value)

Convert a value to a string while avoiding locale.

The standard streams use localizarion that interfers with multiple threads.

Template Parameters
TBase type of the calculation.
Parameters
[in]valueValue to convert.
Returns
String with the value.

◆ get_type_string()

template<float_scalar T>
std::string jit::get_type_string ( )

Get the type string.

Template Parameters
TBase type of the calculation.
Returns
The type as a string.

◆ max_base()

template<float_scalar T>
constexpr int jit::max_base ( )
constexpr

The maximum value for a base type.

Template Parameters
TBase type of the calculation.
Returns
The maximum number of digits needed.

◆ max_digits10()

template<float_scalar T>
constexpr int jit::max_digits10 ( )
constexpr

The maximum number of digits to represent a type literal.

Template Parameters
TBase type of the calculation.
Returns
The maximum number of digits needed.

◆ smallest_int_type()

template<float_scalar T>
std::string jit::smallest_int_type ( const size_t  max_size)

Get smallest integer type.

Template Parameters
TBase type of the calculation.
Parameters
[in]max_sizeThe maximum size needed.
Returns
The smallest integer type as a string.

◆ to_string()

template<class NODE >
std::string jit::to_string ( const char  prefix,
const NODE *  pointer 
)

Convert a graph::leaf_node pointer to a string.

This converts the point value into a string of format t######. Where t is of type

  1. v Variable
  2. r Register
  3. i Input
Template Parameters
NODENode class type.
Parameters
[in]prefixType prefix for the name.
[in]pointerAddress of the graph::leaf_node.
Returns
The pointer value as a string.

◆ type_to_string()

template<float_scalar T>
std::string jit::type_to_string ( )

Convert a base type to a string.

Template Parameters
TBase type of the calculation.
Returns
A constant string literal of the type.

◆ use_gpu()

template<float_scalar T>
constexpr bool jit::use_gpu ( )
constexpr

Test to use the GPU.

Template Parameters
TBase type of the calculation.

◆ use_metal()

template<float_scalar T>
constexpr bool jit::use_metal ( )
constexpr

Test to use metal.

Template Parameters
TBase type of the calculation.