ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Namespaces | Classes | Enumerations | Functions
container Namespace Reference

Namespaces

namespace  BlasConnector
 
namespace  cuBlasConnector
 
namespace  cuSolverConnector
 
namespace  einsum_utils
 
namespace  hipBlasConnector
 
namespace  hipSolverConnector
 
namespace  kernels
 
namespace  lapackConnector
 
namespace  op
 

Classes

struct  ContainerToPsi
 
struct  ContainerToPsi< container::DEVICE_CPU >
 
struct  ContainerToPsi< container::DEVICE_GPU >
 
struct  DataTypeToEnum
 Template struct for mapping a DataType to its corresponding enum value. More...
 
struct  DataTypeToEnum< double >
 
struct  DataTypeToEnum< float >
 
struct  DataTypeToEnum< int >
 
struct  DataTypeToEnum< int64_t >
 
struct  DataTypeToEnum< std::complex< double > >
 
struct  DataTypeToEnum< std::complex< float > >
 
struct  DefaultPtrTraits
 
struct  DEVICE_CPU
 A tag type for identifying CPU and GPU devices. More...
 
struct  DEVICE_GPU
 
struct  DeviceTypeToEnum
 Template struct for mapping a Device Type to its corresponding enum value. More...
 
struct  DeviceTypeToEnum< base_device::DEVICE_CPU >
 
struct  DeviceTypeToEnum< base_device::DEVICE_GPU >
 
struct  DeviceTypeToEnum< DEVICE_CPU >
 
struct  DeviceTypeToEnum< DEVICE_GPU >
 
struct  EinsumOption
 
struct  GetTypeReal
 Template struct to determine the return type based on the input type. More...
 
struct  GetTypeReal< std::complex< double > >
 Specialization of GetTypeReal for std::complex<double>. More...
 
struct  GetTypeReal< std::complex< float > >
 Specialization of GetTypeReal for std::complex<float>. More...
 
struct  PsiToContainer
 
struct  PsiToContainer< base_device::DEVICE_CPU >
 
struct  PsiToContainer< base_device::DEVICE_GPU >
 
class  Tensor
 A multi-dimensional array of elements of a single data type. More...
 
class  TensorAccessor
 
class  TensorAccessor< T, 1, index_t, PtrTraits >
 
class  TensorAccessorBase
 
class  TensorAccessorTest
 
class  TensorBuffer
 Interface to access the raw ref-counted data buffer. More...
 
class  TensorMap
 A multi-dimensional reference array of elements of a single data type. More...
 
class  TensorShape
 A class for representing the shape of a tensor. More...
 

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)
 

Enumeration Type Documentation

◆ DataType

enum class container::DataType
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.

Enumerator
DT_INVALID 

Invalid data type *‍/.

DT_FLOAT 

Single-precision floating point *‍/.

DT_DOUBLE 

Double-precision floating point *‍/.

DT_INT 

32-bit integer *‍/

DT_INT64 

64-bit integer *‍/

DT_COMPLEX 

32-bit complex *‍/

DT_COMPLEX_DOUBLE 

64-bit complex

◆ DeviceType

enum class container::DeviceType
strong

The type of memory used by an allocator.

Enumerator
UnKnown 

Memory type is unknown.

CpuDevice 

Memory type is CPU.

GpuDevice 

Memory type is GPU(CUDA or ROCm).

Function Documentation

◆ _get_digit_places() [1/2]

template<typename T >
__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.

Template Parameters
TThe type of the array.
Parameters
arrThe array of numbers.
sizeThe size of the array.
integer_countThe length of the longest integer part.
fraction_countThe length of the longest fractional part.
Returns
The total length of the longest integer and fractional part.

◆ _get_digit_places() [2/2]

template<typename T >
__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.

Template Parameters
TThe type of the array.
Parameters
arrThe array of numbers.
sizeThe size of the array.
integer_countThe length of the longest integer part.
fraction_countThe length of the longest fractional part.
Returns
The total length of the longest integer and fractional part.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _internal_output()

template<typename T >
__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.

Template Parameters
TThe data type of the tensor.
Parameters
osThe output stream to which the tensor data is to be printed.
dataA pointer to the tensor data.
shapeThe shape of the tensor.
num_elementsThe total number of elements in the tensor.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _output_wrapper() [1/3]

template<>
__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.

Parameters
osThe output stream to write the data to.
dataThe data value to output.
digit_widthThe minimum width for the output.
fraction_countThe number of digits to display after the decimal point.

◆ _output_wrapper() [2/3]

template<typename T >
__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.

Template Parameters
TThe type of data to output.
Parameters
osThe output stream to write the data to.
dataThe data value to output.
digit_widthThe minimum width for the output.
fraction_countThe number of digits to display after the decimal point.

◆ _output_wrapper() [3/3]

template<typename T >
__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.

Template Parameters
TThe type of data to output.
Parameters
osThe output stream to write the data to.
dataThe data value to output.
digit_widthThe minimum width for the output.
fraction_countThe number of digits to display after the decimal point.
Here is the caller graph for this function:

◆ extract()

template<typename T >
T container::extract ( const container::Tensor tensor)
Here is the call graph for this function:

◆ operator<<() [1/4]

std::ostream & container::operator<< ( std::ostream &  os,
const DataType data_type 
)

Overloaded operator<< for the Tensor class.

Prints the data type of the enum type DataType.

Parameters
osThe output stream to write to.
tensorThe Tensor object to print.
Returns
The output stream.

◆ operator<<() [2/4]

std::ostream & container::operator<< ( std::ostream &  os,
const DeviceType memory_type 
)

Overloaded operator<< for the Tensor class.

Prints the memory type of the enum type MemoryType.

Parameters
osThe output stream to write to.
tensorThe Tensor object to print.
Returns
The output stream.

◆ operator<<() [3/4]

std::ostream & container::operator<< ( std::ostream &  os,
const Tensor tensor 
)

Overloaded operator<< for the Tensor class.

Prints the data of the Tensor object to the given output stream.

Parameters
osThe output stream to write to.
tensorThe Tensor object to print.
Returns
The output stream.
Here is the call graph for this function:

◆ operator<<() [4/4]

std::ostream & container::operator<< ( std::ostream &  os,
const TensorShape shape 
)

Overload the << operator to print TensorShape objects.

Parameters
osThe output stream to which the tensor shape is printed.
shapeThe TensorShape object to be printed.
Returns
A reference to the output stream.
Here is the call graph for this function:

◆ removeTrailingZeros()

__inline__ std::string container::removeTrailingZeros ( std::string  str)

Removes trailing zeros from a string.

This function removes any trailing zeros from a given string.

Parameters
strThe string to remove trailing zeros from.
Returns
A string without trailing zeros.
Here is the caller graph for this function:

◆ TEST() [1/21]

container::TEST ( Tensor  ,
Accessor   
)
Here is the call graph for this function:

◆ TEST() [2/21]

container::TEST ( Tensor  ,
AllocateFrom   
)
Here is the call graph for this function:

◆ TEST() [3/21]

container::TEST ( Tensor  ,
Buffer   
)
Here is the call graph for this function:

◆ TEST() [4/21]

container::TEST ( Tensor  ,
Cast   
)
Here is the call graph for this function:

◆ TEST() [5/21]

container::TEST ( Tensor  ,
Constructor   
)
Here is the call graph for this function:

◆ TEST() [6/21]

container::TEST ( Tensor  ,
CopyFrom   
)
Here is the call graph for this function:

◆ TEST() [7/21]

container::TEST ( Tensor  ,
CopyFromWithReshape   
)
Here is the call graph for this function:

◆ TEST() [8/21]

container::TEST ( Tensor  ,
GetAllocatorDeathTest   
)
Here is the call graph for this function:

◆ TEST() [9/21]

container::TEST ( Tensor  ,
GetDataPointer   
)
Here is the call graph for this function:

◆ TEST() [10/21]

container::TEST ( Tensor  ,
GetDataPointerDeathTest   
)
Here is the call graph for this function:

◆ TEST() [11/21]

container::TEST ( Tensor  ,
GetValueAndInnerMostPtr   
)

◆ TEST() [12/21]

container::TEST ( Tensor  ,
OutputOperator   
)

◆ TEST() [13/21]

container::TEST ( Tensor  ,
Reshape   
)

◆ TEST() [14/21]

container::TEST ( Tensor  ,
ReshapeDeathTest   
)
Here is the call graph for this function:

◆ TEST() [15/21]

container::TEST ( Tensor  ,
Resize   
)
Here is the call graph for this function:

◆ TEST() [16/21]

container::TEST ( Tensor  ,
SizeOfType   
)
Here is the call graph for this function:

◆ TEST() [17/21]

container::TEST ( Tensor  ,
SizeOfTypeDeathTest   
)
Here is the call graph for this function:

◆ TEST() [18/21]

container::TEST ( Tensor  ,
Slice   
)
Here is the call graph for this function:

◆ TEST() [19/21]

container::TEST ( Tensor  ,
SubTensor   
)
Here is the call graph for this function:

◆ TEST() [20/21]

container::TEST ( Tensor  ,
Sync   
)
Here is the call graph for this function:

◆ TEST() [21/21]

container::TEST ( Tensor  ,
ToDeviceAndSetZero   
)
Here is the call graph for this function:

◆ TEST_F()

container::TEST_F ( TensorAccessorTest  ,
TensorAccessorTest   
)