ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Namespaces | |
namespace | BlasConnector |
namespace | cuBlasConnector |
namespace | cuSolverConnector |
namespace | einsum_utils |
namespace | hipBlasConnector |
namespace | hipSolverConnector |
namespace | kernels |
namespace | lapackConnector |
namespace | op |
Enumerations | |
enum class | DataType { DT_INVALID = 0 , DT_FLOAT = 1 , DT_DOUBLE = 2 , DT_INT = 3 , DT_INT64 = 4 , DT_COMPLEX = 5 , DT_COMPLEX_DOUBLE = 6 } |
Enumeration of data types for tensors. The DataType enum lists the supported data types for tensors. Each data type is identified by a unique value. The DT_INVALID value is reserved for invalid data types. More... | |
enum class | DeviceType { UnKnown = 0 , CpuDevice = 1 , GpuDevice = 2 } |
The type of memory used by an allocator. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &os, const Tensor &tensor) |
Overloaded operator<< for the Tensor class. | |
std::ostream & | operator<< (std::ostream &os, const TensorShape &shape) |
Overload the << operator to print TensorShape objects. | |
std::ostream & | operator<< (std::ostream &os, const DataType &data_type) |
Overloaded operator<< for the Tensor class. | |
std::ostream & | operator<< (std::ostream &os, const DeviceType &memory_type) |
Overloaded operator<< for the Tensor class. | |
__inline__ std::string | removeTrailingZeros (std::string str) |
Removes trailing zeros from a string. | |
template<typename T > | |
__inline__ int | _get_digit_places (const T *arr, int size, int &integer_count, int &fraction_count) |
Calculates the length of the longest integer and fractional part of an array of numbers. | |
template<typename T > | |
__inline__ int | _get_digit_places (const std::complex< T > *arr, int size, int &integer_count, int &fraction_count) |
Overloaded function to calculate the length of the longest integer and fractional part of an array of complex numbers. | |
template<typename T > | |
__inline__ void | _output_wrapper (std::ostream &os, const T data, const int &digit_width, const int &fraction_count) |
Output wrapper for a data value with given formatting parameters. | |
template<typename T > | |
__inline__ void | _output_wrapper (std::ostream &os, const std::complex< T > data, const int &digit_width, const int &fraction_count) |
Output wrapper for a complex data value with given formatting parameters. | |
template<> | |
__inline__ void | _output_wrapper (std::ostream &os, const int data, const int &digit_width, const int &fraction_count) |
Output wrapper for an integer data value with given formatting parameters. | |
template<typename T > | |
__inline__ void | _internal_output (std::ostream &os, const T *data, const TensorShape &shape, const int64_t &num_elements) |
Outputs tensor data to a given output stream. | |
template<typename T > | |
T | extract (const container::Tensor &tensor) |
TEST_F (TensorAccessorTest, TensorAccessorTest) | |
TEST (Tensor, Constructor) | |
TEST (Tensor, GetDataPointer) | |
TEST (Tensor, GetDataPointerDeathTest) | |
TEST (Tensor, SizeOfType) | |
TEST (Tensor, SizeOfTypeDeathTest) | |
TEST (Tensor, ToDeviceAndSetZero) | |
TEST (Tensor, Cast) | |
TEST (Tensor, Reshape) | |
TEST (Tensor, GetValueAndInnerMostPtr) | |
TEST (Tensor, ReshapeDeathTest) | |
TEST (Tensor, Slice) | |
TEST (Tensor, Buffer) | |
TEST (Tensor, Resize) | |
TEST (Tensor, GetAllocatorDeathTest) | |
TEST (Tensor, OutputOperator) | |
TEST (Tensor, CopyFrom) | |
TEST (Tensor, CopyFromWithReshape) | |
TEST (Tensor, AllocateFrom) | |
TEST (Tensor, Sync) | |
TEST (Tensor, SubTensor) | |
TEST (Tensor, Accessor) | |
|
strong |
Enumeration of data types for tensors. The DataType enum lists the supported data types for tensors. Each data type is identified by a unique value. The DT_INVALID value is reserved for invalid data types.
|
strong |
__inline__ int container::_get_digit_places | ( | const std::complex< T > * | arr, |
int | size, | ||
int & | integer_count, | ||
int & | fraction_count | ||
) |
Overloaded function to calculate the length of the longest integer and fractional part of an array of complex numbers.
This function is an overloaded version of _get_digit_places for an array of complex numbers.
T | The type of the array. |
arr | The array of numbers. |
size | The size of the array. |
integer_count | The length of the longest integer part. |
fraction_count | The length of the longest fractional part. |
__inline__ int container::_get_digit_places | ( | const T * | arr, |
int | size, | ||
int & | integer_count, | ||
int & | fraction_count | ||
) |
Calculates the length of the longest integer and fractional part of an array of numbers.
This function takes an array of numbers and determines the length of the longest integer and fractional part.
T | The type of the array. |
arr | The array of numbers. |
size | The size of the array. |
integer_count | The length of the longest integer part. |
fraction_count | The length of the longest fractional part. |
__inline__ void container::_internal_output | ( | std::ostream & | os, |
const T * | data, | ||
const TensorShape & | shape, | ||
const int64_t & | num_elements | ||
) |
Outputs tensor data to a given output stream.
This function outputs tensor data to the specified output stream. It determines the format of the tensor data and prints it accordingly. The format is determined based on the number of dimensions of the tensor.
T | The data type of the tensor. |
os | The output stream to which the tensor data is to be printed. |
data | A pointer to the tensor data. |
shape | The shape of the tensor. |
num_elements | The total number of elements in the tensor. |
__inline__ void container::_output_wrapper | ( | std::ostream & | os, |
const int | data, | ||
const int & | digit_width, | ||
const int & | fraction_count | ||
) |
Output wrapper for an integer data value with given formatting parameters.
os | The output stream to write the data to. |
data | The data value to output. |
digit_width | The minimum width for the output. |
fraction_count | The number of digits to display after the decimal point. |
__inline__ void container::_output_wrapper | ( | std::ostream & | os, |
const std::complex< T > | data, | ||
const int & | digit_width, | ||
const int & | fraction_count | ||
) |
Output wrapper for a complex data value with given formatting parameters.
T | The type of data to output. |
os | The output stream to write the data to. |
data | The data value to output. |
digit_width | The minimum width for the output. |
fraction_count | The number of digits to display after the decimal point. |
__inline__ void container::_output_wrapper | ( | std::ostream & | os, |
const T | data, | ||
const int & | digit_width, | ||
const int & | fraction_count | ||
) |
Output wrapper for a data value with given formatting parameters.
T | The type of data to output. |
os | The output stream to write the data to. |
data | The data value to output. |
digit_width | The minimum width for the output. |
fraction_count | The number of digits to display after the decimal point. |
T container::extract | ( | const container::Tensor & | tensor | ) |
std::ostream & container::operator<< | ( | std::ostream & | os, |
const DataType & | data_type | ||
) |
std::ostream & container::operator<< | ( | std::ostream & | os, |
const DeviceType & | memory_type | ||
) |
std::ostream & container::operator<< | ( | std::ostream & | os, |
const Tensor & | tensor | ||
) |
std::ostream & container::operator<< | ( | std::ostream & | os, |
const TensorShape & | shape | ||
) |
Overload the << operator to print TensorShape objects.
os | The output stream to which the tensor shape is printed. |
shape | The TensorShape object to be printed. |
__inline__ std::string container::removeTrailingZeros | ( | std::string | str | ) |
Removes trailing zeros from a string.
This function removes any trailing zeros from a given string.
str | The string to remove trailing zeros from. |
container::TEST | ( | Tensor | , |
Accessor | |||
) |
container::TEST | ( | Tensor | , |
AllocateFrom | |||
) |
container::TEST | ( | Tensor | , |
Buffer | |||
) |
container::TEST | ( | Tensor | , |
Cast | |||
) |
container::TEST | ( | Tensor | , |
Constructor | |||
) |
container::TEST | ( | Tensor | , |
CopyFrom | |||
) |
container::TEST | ( | Tensor | , |
CopyFromWithReshape | |||
) |
container::TEST | ( | Tensor | , |
GetAllocatorDeathTest | |||
) |
container::TEST | ( | Tensor | , |
GetDataPointer | |||
) |
container::TEST | ( | Tensor | , |
GetDataPointerDeathTest | |||
) |
container::TEST | ( | Tensor | , |
GetValueAndInnerMostPtr | |||
) |
container::TEST | ( | Tensor | , |
OutputOperator | |||
) |
container::TEST | ( | Tensor | , |
Reshape | |||
) |
container::TEST | ( | Tensor | , |
ReshapeDeathTest | |||
) |
container::TEST | ( | Tensor | , |
Resize | |||
) |
container::TEST | ( | Tensor | , |
SizeOfType | |||
) |
container::TEST | ( | Tensor | , |
SizeOfTypeDeathTest | |||
) |
container::TEST | ( | Tensor | , |
Slice | |||
) |
container::TEST | ( | Tensor | , |
SubTensor | |||
) |
container::TEST | ( | Tensor | , |
Sync | |||
) |
container::TEST | ( | Tensor | , |
ToDeviceAndSetZero | |||
) |
container::TEST_F | ( | TensorAccessorTest | , |
TensorAccessorTest | |||
) |