Classes | |
| class | Algorithms |
| struct | copyCast_ |
| class | stackVector |
| Stack based vector. More... | |
Enumerations | |
| enum class | Backend : int8_t { Serial = 0 , Hip_Cuda = 1 , Kokkos = 2 , OpenMP = 3 , OpenACC = 4 , OpenCL = 5 , RAJA = 6 } |
| Enum to store the backend used for gpu acceleration. More... | |
| enum class | ExecutionSpace : int8_t { unspecified , cpu , device } |
| enum class | MemoryType : int8_t { none = -1 , unregistered = 0 , host = 1 , managed = 2 , device = 3 } |
| Enum to store pointer type. More... | |
Functions | |
| template<class T > | |
| bool | approx_equal (const T &v1, const T &v2, const T tol=type_default_tol< T >()) |
| template<class T > | |
| bool | approx_equal_abs (const T &v1, const T &v2, const T tol=type_default_tol< T >()) |
| Backend | backendFromString (const std::string_view name) |
| double | bilinear (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &f, double xi, double yi) |
| std::string | blockToString (int num) |
| void | busy_ms (int N) |
| void | busy_s (int N) |
| template<class T1 , class T2 > | |
| void | copy (size_t N, const T1 *src, T2 *dst) |
| Perform copy with conversion if necessary. | |
| template<typename T1 , typename T2 , Backend , class Allocator > | |
| void | copyCast (const size_t len, const T1 *vec_in, T2 *vec_out) |
| template<typename T1 , typename T2 , Backend > | |
| void | copyCast (const size_t len, const T1 *vec_in, T2 *vec_out) |
| std::string | demangle (const std::string &name) |
| ExecutionSpace | executionSpaceFromString (const std::string_view name) |
| std::vector< int > | factor (uint64_t) |
| Get the prime factors for a number. | |
| void | fillRandom (std::vector< double > &) |
| Fill with random values in [0,1]. | |
| template<size_t N> | |
| void | fillRandom (std::vector< std::array< double, N > > &) |
| Fill with random values in [0,1]. | |
| void | finalizeKokkos () |
| template<class T > | |
| size_t | findfirst (const std::vector< T > &x, const T &value) |
| template<class T > | |
| size_t | findfirst (size_t N, const T *x, const T &value) |
| template<typename ALLOC > | |
| constexpr AMP::Utilities::MemoryType | getAllocatorMemoryType () |
| Backend | getDefaultBackend (const MemoryType memory_location) |
| ExecutionSpace | getDefaultExecutionSpace (const MemoryType memory_location) |
| std::string | getenv (const char *name) |
| std::string | getLastErrnoString () |
| Return the string description for the last value in errno (thread-safe) | |
| MemoryType | getMemoryType (const void *ptr) |
| Return the pointer type. | |
| std::string_view | getString (const Backend backend) |
| std::string_view | getString (const ExecutionSpace exec_space) |
| std::string_view | getString (MemoryType) |
| Return a string for the memory type. | |
| constexpr unsigned int | hash_char (const std::string_view &str) |
| Create a hash key from a char array. | |
| void | initializeKokkos (int &argc, char *argv[], const AMPManagerProperties &) |
| std::string | intToString (int num, int min_width=1) |
| template<class TYPE > | |
| bool | isInf (TYPE x) |
| Check if a number infinity. | |
| bool | isKokkosInitialized () |
| template<class TYPE > | |
| bool | isNaN (TYPE x) |
| Check if a number NaN. | |
| bool | isPrime (uint64_t) |
| Check if a number is prime. | |
| bool | KokkosEnabled () |
| bool | KokkosInitializedOpenMP () |
| std::string | levelToString (int num) |
| double | linear (const std::vector< double > &x, const std::vector< double > &f, double xi) |
| void | memcpy (void *dest, const void *src, std::size_t count) |
| Perform memory-memory copy (pointer may be in any memory space) | |
| MemoryType | memoryLocationFromString (std::string_view name) |
| Return the memory type from a string. | |
| void | memset (void *dest, int ch, std::size_t count) |
| Perform memory set (pointer may be in any memory space) | |
| std::string | nodeToString (int num) |
| void | nullUse (const void *) |
| Null use function. | |
| std::string | patchToString (int num) |
| std::vector< uint64_t > | primes (uint64_t) |
| Return all prime numbers <= x. | |
| void | printBanner () |
| Print AMP Banner. | |
| void | printDatabase (const Database &, std::ostream &, const std::string &indent="") |
| Print a database. | |
| std::string | processorToString (int num) |
| template<class T > | |
| void | quicksort (size_t N, T *x) |
| template<class T1 , class T2 > | |
| void | quicksort (size_t N, T1 *x, T2 *y) |
| template<class T1 , class T2 , class T3 > | |
| void | quicksort (size_t N, T1 *x, T2 *y, T3 *z) |
| template<class T > | |
| void | quicksort (std::vector< T > &x) |
| template<class T1 , class T2 > | |
| void | quicksort (std::vector< T1 > &x, std::vector< T2 > &y) |
| std::string | randomString (const AMP::AMP_MPI &comm=AMP_COMM_NULL) |
| Function to return a unique alpha-numeric string across a given communicator. | |
| bool | running_valgrind () |
| Check if valgrind is running. | |
| void | setenv (const char *name, const char *value) |
| void | setNestedOperatorMemoryLocations (std::shared_ptr< AMP::Database > input_db, std::string outerOperatorName, std::vector< std::string > nestedOperatorNames) |
| void | sleep_ms (int N) |
| void | sleep_s (int N) |
| std::string | stringf (const char *format,...) |
| std::string version of sprintf | |
| std::string | strrep (const std::string &str, const std::string &s, const std::string &r) |
| template<class TYPE > | |
| std::string | to_string (const std::vector< TYPE > &x) |
| Print a vector. | |
| double | trilinear (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &f, double xi, double yi, double zi) |
| template<class T > | |
| void | unique (std::vector< T > &x) |
| template<class T > | |
| void | unique (std::vector< T > &X, std::vector< size_t > &I) |
| void | zero (void *dest, std::size_t count) |
| Perform memory zero (pointer may be in any memory space) | |
Utilities is a namespace containing basic routines for error reporting, file manipulations, etc. Included are a set of macros that are commonly used.
|
strong |
|
strong |
|
strong |
|
inline |
Soft equal checks if two numbers are within the given precision True iff abs(v1-v2)/v1 < tol
| v1 | scalar floating point value |
| v2 | scalar floating point value |
| tol | relative tolerance |
Definition at line 146 of file Utilities.h.
|
inline |
Soft equal checks if two numbers are equivalent within the given precision True iff abs(v1-v2) < tol
| v1 | scalar floating point value |
| v2 | scalar floating point value |
| tol | relative tolerance |
Definition at line 162 of file Utilities.h.
| Backend AMP::Utilities::backendFromString | ( | const std::string_view | name | ) |
| double AMP::Utilities::bilinear | ( | const std::vector< double > & | x, |
| const std::vector< double > & | y, | ||
| const std::vector< double > & | f, | ||
| double | xi, | ||
| double | yi | ||
| ) |
Function to perform tri-linear interpolation
| x | x-coordinates |
| y | y-coordinates |
| f | function values at the coordinates ( Nx x Ny ) |
| xi | x-coordinate of desired point |
| yi | y-coordinate of desired point |
| std::string AMP::Utilities::blockToString | ( | int | num | ) |
| void AMP::Utilities::busy_ms | ( | int | N | ) |
|
inline |
Busy wait for X s
| N | Time to wait (s) |
Definition at line 366 of file Utilities.h.
References busy_ms().
| void AMP::Utilities::copy | ( | size_t | N, |
| const T1 * | src, | ||
| T2 * | dst | ||
| ) |
Perform copy with conversion if necessary.
| void AMP::Utilities::copyCast | ( | const size_t | len, |
| const T1 * | vec_in, | ||
| T2 * | vec_out | ||
| ) |
Helper function to copy and cast (single<->double precision) values between two arrays
| [in] | len | Length of above vectors |
| [in] | vec_in | The incoming vector to get the values from |
| [in,out] | vec_out | The outgoing vector to with the up/down-casted values from vec_in It is assumed that vec_out is properly allocated |
| void AMP::Utilities::copyCast | ( | const size_t | len, |
| const T1 * | vec_in, | ||
| T2 * | vec_out | ||
| ) |
| std::string AMP::Utilities::demangle | ( | const std::string & | name | ) |
| ExecutionSpace AMP::Utilities::executionSpaceFromString | ( | const std::string_view | name | ) |
| std::vector< int > AMP::Utilities::factor | ( | uint64_t | ) |
Get the prime factors for a number.
| void AMP::Utilities::fillRandom | ( | std::vector< double > & | ) |
Fill with random values in [0,1].
| void AMP::Utilities::fillRandom | ( | std::vector< std::array< double, N > > & | ) |
Fill with random values in [0,1].
| void AMP::Utilities::finalizeKokkos | ( | ) |
|
inline |
Search a std::vector for the first entry >= the given value This routine only works on sorted arrays and does not check if the array is sorted This routine returns the size of the vector if no entries in the vector are >= the desired entry.
| x | vector to sort |
| value | Value to search for |
Definition at line 269 of file Utilities.h.
References findfirst().
| size_t AMP::Utilities::findfirst | ( | size_t | N, |
| const T * | x, | ||
| const T & | value | ||
| ) |
Search a std::vector for the first entry >= the given value This routine only works on sorted arrays and does not check if the array is sorted This routine returns the size of the vector if no entries in the vector are >= the desired entry.
| N | Number of entires to search |
| x | vector to sort |
| value | Value to search for |
Referenced by findfirst().
|
constexpr |
| Backend AMP::Utilities::getDefaultBackend | ( | const MemoryType | memory_location | ) |
| ExecutionSpace AMP::Utilities::getDefaultExecutionSpace | ( | const MemoryType | memory_location | ) |
| std::string AMP::Utilities::getenv | ( | const char * | name | ) |
Get an environmental variable
| name | The name of the environmental variable |
| std::string AMP::Utilities::getLastErrnoString | ( | ) |
Return the string description for the last value in errno (thread-safe)
| MemoryType AMP::Utilities::getMemoryType | ( | const void * | ptr | ) |
Return the pointer type.
| std::string_view AMP::Utilities::getString | ( | const Backend | backend | ) |
| std::string_view AMP::Utilities::getString | ( | const ExecutionSpace | exec_space | ) |
Referenced by AMP::LinearAlgebra::CSRMatrixData< Config >::printStats().
| std::string_view AMP::Utilities::getString | ( | MemoryType | ) |
Return a string for the memory type.
|
constexpr |
Create a hash key from a char array.
Definition at line 317 of file Utilities.h.
| void AMP::Utilities::initializeKokkos | ( | int & | argc, |
| char * | argv[], | ||
| const AMPManagerProperties & | |||
| ) |
| std::string AMP::Utilities::intToString | ( | int | num, |
| int | min_width = 1 |
||
| ) |
Convert an integer to a string.
The returned string is padded with zeros as needed so that it contains at least the number of characters indicated by the minimum width argument. When the number is positive, the string is padded on the left. When the number is negative, the '-' sign appears first, followed by the integer value padded on the left with zeros. For example, the statement intToString(12, 5) returns "00012" and the statement intToString(-12, 5) returns "-0012".
| bool AMP::Utilities::isInf | ( | TYPE | x | ) |
Check if a number infinity.
| bool AMP::Utilities::isKokkosInitialized | ( | ) |
| bool AMP::Utilities::isNaN | ( | TYPE | x | ) |
Check if a number NaN.
| bool AMP::Utilities::isPrime | ( | uint64_t | ) |
Check if a number is prime.
| bool AMP::Utilities::KokkosEnabled | ( | ) |
| bool AMP::Utilities::KokkosInitializedOpenMP | ( | ) |
| std::string AMP::Utilities::levelToString | ( | int | num | ) |
| double AMP::Utilities::linear | ( | const std::vector< double > & | x, |
| const std::vector< double > & | f, | ||
| double | xi | ||
| ) |
Function to perform linear interpolation
| x | x-coordinates |
| f | function values at the coordinates ( Nx ) |
| xi | x-coordinate of desired point |
| void AMP::Utilities::memcpy | ( | void * | dest, |
| const void * | src, | ||
| std::size_t | count | ||
| ) |
Perform memory-memory copy (pointer may be in any memory space)
| MemoryType AMP::Utilities::memoryLocationFromString | ( | std::string_view | name | ) |
Return the memory type from a string.
| void AMP::Utilities::memset | ( | void * | dest, |
| int | ch, | ||
| std::size_t | count | ||
| ) |
Perform memory set (pointer may be in any memory space)
| std::string AMP::Utilities::nodeToString | ( | int | num | ) |
Convert common integer values to strings.
These are simply wrappers around intToString that ensure the same width is uniformly used when converting to string representations.
| void AMP::Utilities::nullUse | ( | const void * | ) |
Null use function.
| std::string AMP::Utilities::patchToString | ( | int | num | ) |
| std::vector< uint64_t > AMP::Utilities::primes | ( | uint64_t | ) |
Return all prime numbers <= x.
| void AMP::Utilities::printBanner | ( | ) |
Print AMP Banner.
| void AMP::Utilities::printDatabase | ( | const Database & | , |
| std::ostream & | , | ||
| const std::string & | indent = "" |
||
| ) |
Print a database.
| std::string AMP::Utilities::processorToString | ( | int | num | ) |
| void AMP::Utilities::quicksort | ( | size_t | N, |
| T * | x | ||
| ) |
Quicksort a std::vector
| N | Number of entries to sort |
| x | vector to sort |
Referenced by quicksort(), and quicksort().
| void AMP::Utilities::quicksort | ( | size_t | N, |
| T1 * | x, | ||
| T2 * | y | ||
| ) |
Quicksort a vector
| N | Number of entries to sort |
| x | Vector to sort |
| y | Extra values to be sorted with X |
| void AMP::Utilities::quicksort | ( | size_t | N, |
| T1 * | x, | ||
| T2 * | y, | ||
| T3 * | z | ||
| ) |
Quicksort a vector
| N | Number of entries to sort |
| x | Vector to sort |
| y | Extra values to be sorted with x |
| z | Extra values to be sorted with x |
|
inline |
Quicksort a std::vector
| x | vector to sort |
Definition at line 195 of file Utilities.h.
References quicksort().
|
inline |
Quicksort a std::vector
| x | Vector to sort |
| y | Extra values to be sorted with x |
Definition at line 215 of file Utilities.h.
References AMP_INSIST, and quicksort().
| std::string AMP::Utilities::randomString | ( | const AMP::AMP_MPI & | comm = AMP_COMM_NULL | ) |
Function to return a unique alpha-numeric string across a given communicator.
This will return a unique alpha-numeric string on the given communicator. The string will be the same on all processors, but unique for all subsequent calls to this routine regardless of the communicator used. Note: this is a blocking call on the given communicator.
| bool AMP::Utilities::running_valgrind | ( | ) |
Check if valgrind is running.
| void AMP::Utilities::setenv | ( | const char * | name, |
| const char * | value | ||
| ) |
Set an environmental variable
| name | The name of the environmental variable |
| value | The value to set |
| void AMP::Utilities::setNestedOperatorMemoryLocations | ( | std::shared_ptr< AMP::Database > | input_db, |
| std::string | outerOperatorName, | ||
| std::vector< std::string > | nestedOperatorNames | ||
| ) |
|
inline |
|
inline |
|
inline |
| std::string AMP::Utilities::strrep | ( | const std::string & | str, |
| const std::string & | s, | ||
| const std::string & | r | ||
| ) |
Replace part of a strig with another
| str | Input string to search/replace |
| s | Search string |
| r | Replacement string |
| std::string AMP::Utilities::to_string | ( | const std::vector< TYPE > & | x | ) |
Print a vector.
| double AMP::Utilities::trilinear | ( | const std::vector< double > & | x, |
| const std::vector< double > & | y, | ||
| const std::vector< double > & | z, | ||
| const std::vector< double > & | f, | ||
| double | xi, | ||
| double | yi, | ||
| double | zi | ||
| ) |
Function to perform tri-linear interpolation
| x | x-coordinates |
| y | y-coordinates |
| z | z-coordinates |
| f | function values at the coordinates ( Nx x Ny x Nz ) |
| xi | x-coordinate of desired point |
| yi | y-coordinate of desired point |
| zi | z-coordinate of desired point |
| void AMP::Utilities::unique | ( | std::vector< T > & | x | ) |
Get the unique set on a std::vector
| x | vector to create the unique set (elements will be returned in sorted order) |
| void AMP::Utilities::unique | ( | std::vector< T > & | X, |
| std::vector< size_t > & | I | ||
| ) |
Subroutine to perform the unique operation on the elements in X This function performs the unique operation on the values in X storing them in Y. It also returns the index vector I such that Y[k] = X[I[k]].
| X | Points to sort (nx) |
| I | The index vector I (ny) |
| void AMP::Utilities::zero | ( | void * | dest, |
| std::size_t | count | ||
| ) |
Perform memory zero (pointer may be in any memory space)
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:45. Comments on this page |