25 std::same_as<T, std::complex<double>>;
38 std::same_as<T, std::complex<float>>;
43 std::same_as<T, std::complex<double>>;
46 static bool verbose = USE_VERBOSE;
55 template<
float_scalar T>
80 template<
float_scalar T>
94 template<
float_scalar T>
96 return use_cuda() || use_metal<T> ();
107 template<
float_scalar T>
109 if (max_size <= std::numeric_limits<unsigned char>::max()) {
110 if constexpr (jit::use_metal<T> ()) {
113 return "unsigned char";
115 }
else if (max_size <= std::numeric_limits<unsigned short>::max()) {
116 if constexpr (jit::use_metal<T> ()) {
119 return "unsigned short";
121 }
else if (max_size <= std::numeric_limits<unsigned int>::max()) {
122 if constexpr (jit::use_metal<T> ()) {
125 return "unsigned int";
128 if constexpr (jit::use_metal<T> ()) {
143 template<
float_scalar T>
147 return "cuda::std::complex<" + type_to_string<T> () +
">";
149 return "std::complex<" + type_to_string<T> () +
">";
152 return type_to_string<T> ();
163 template<
float_scalar T>
165 stream << get_type_string<T> ();
175 template<
float_scalar T>
178 return std::numeric_limits<float>::max_digits10;
180 return std::numeric_limits<double>::max_digits10;
191 template<
float_scalar T>
194 return std::numeric_limits<float>::max();
196 return std::numeric_limits<double>::max();
212 std::array<char, 36> buffer;
214 if constexpr (std::is_same<T, size_t>::value) {
215 end = std::to_chars(buffer.begin(),
222 end = std::to_chars(buffer.begin(), buffer.end(),
223 value, std::chars_format::general,
224 max_digits10<T> ()).ptr;
226 return std::string(buffer.data(), end);
246 const NODE *pointer) {
247 assert((prefix ==
'r' || prefix ==
'v' ||
248 prefix ==
'o' || prefix ==
'a' ||
249 prefix ==
'i' || prefix ==
's') &&
250 "Expected a variable (v), register (r), output (o), array (a), index (i), or state (s) prefix.");
251 return std::string(1, prefix) +
271 template<
float_scalar T>
282 return std::abs(left) < std::abs(right);
Define a custom comparitor class.
Definition register.hpp:272
bool operator()(const T &left, const T &right) const
Call operator.
Definition register.hpp:280
Complex scalar concept.
Definition register.hpp:24
Double base concept.
Definition register.hpp:42
float base concept.
Definition register.hpp:37
Float scalar concept.
Definition register.hpp:29
General scalar concept.
Definition register.hpp:33
subroutine assert(test, message)
Assert check.
Definition f_binding_test.f90:38
Name space for JIT functions.
Definition jit.hpp:41
std::string smallest_int_type(const size_t max_size)
Get smallest integer type.
Definition register.hpp:108
std::map< void *, size_t > texture1d_list
Type alias for indexing 1D textures.
Definition register.hpp:262
constexpr bool use_gpu()
Test to use the GPU.
Definition register.hpp:95
constexpr bool use_metal()
Test to use metal.
Definition register.hpp:81
std::string type_to_string()
Convert a base type to a string.
Definition register.hpp:56
constexpr int max_base()
The maximum value for a base type.
Definition register.hpp:192
std::string format_to_string(const T value)
Convert a value to a string while avoiding locale.
Definition register.hpp:211
std::map< void *, std::array< size_t, 2 > > texture2d_list
Type alias for indexing 2D textures.
Definition register.hpp:264
void add_type(std::basic_ostream< char > &stream)
Write out the node base type to a general stream.
Definition register.hpp:164
std::map< void *, size_t > register_usage
Type alias for counting register usage.
Definition register.hpp:258
std::map< void *, std::string > register_map
Type alias for mapping node pointers to register names.
Definition register.hpp:256
std::string get_type_string()
Get the type string.
Definition register.hpp:144
constexpr bool use_cuda()
Test to use Cuda.
Definition register.hpp:67
std::set< void * > visiter_map
Type alias for listing visited nodes.
Definition register.hpp:260
constexpr int max_digits10()
The maximum number of digits to represent a type literal.
Definition register.hpp:176
std::string to_string(const char prefix, const NODE *pointer)
Convert a graph::leaf_node pointer to a string.
Definition register.hpp:245