ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
container Namespace Reference

Namespaces

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

Classes

class  Tensor
 A multi-dimensional array of elements of a single data type. More...
struct  DefaultPtrTraits
class  TensorAccessorBase
class  TensorAccessor
class  TensorAccessor< T, 1, index_t, PtrTraits >
class  TensorBuffer
 Interface to access the raw ref-counted data buffer. More...
struct  DEVICE_CPU
struct  DEVICE_GPU
struct  DeviceTypeToEnum
struct  DeviceTypeToEnum< DEVICE_CPU >
struct  DeviceTypeToEnum< DEVICE_GPU >
struct  DeviceTypeToEnum< base_device::DEVICE_CPU >
struct  DeviceTypeToEnum< base_device::DEVICE_GPU >
struct  DataTypeToEnum
struct  DataTypeToEnum< int >
struct  DataTypeToEnum< float >
struct  DataTypeToEnum< double >
struct  DataTypeToEnum< int64_t >
struct  DataTypeToEnum< std::complex< float > >
struct  DataTypeToEnum< std::complex< double > >
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...
struct  GetTypeReal
 Template struct to determine the return type based on the input type. More...
struct  GetTypeReal< std::complex< float > >
 Specialization of GetTypeReal for std::complex<float>. More...
struct  GetTypeReal< std::complex< double > >
 Specialization of GetTypeReal for std::complex<double>. More...
struct  PsiToContainer
struct  PsiToContainer< base_device::DEVICE_CPU >
struct  PsiToContainer< base_device::DEVICE_GPU >
struct  ContainerToPsi
struct  ContainerToPsi< container::DEVICE_CPU >
struct  ContainerToPsi< container::DEVICE_GPU >
struct  EinsumOption
class  TensorAccessorTest

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
}
enum class  DeviceType { UnKnown = 0 , CpuDevice = 1 , GpuDevice = 2 }

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, CopyAssignment)
 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, InnerMostPtrBounds)
 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
Enumerator
DT_INVALID 
DT_FLOAT 
DT_DOUBLE 
DT_INT 
DT_INT64 
DT_COMPLEX 
DT_COMPLEX_DOUBLE 

◆ DeviceType

enum class container::DeviceType
strong
Enumerator
UnKnown 
CpuDevice 
GpuDevice 

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.
Here is the call graph for this function:

◆ _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:
Here is the caller 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/23]

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

◆ TEST() [2/23]

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

◆ TEST() [3/23]

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

◆ TEST() [4/23]

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

◆ TEST() [5/23]

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

◆ TEST() [6/23]

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

◆ TEST() [7/23]

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

◆ TEST() [8/23]

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

◆ TEST() [9/23]

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

◆ TEST() [10/23]

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

◆ TEST() [11/23]

container::TEST ( Tensor ,
GetDataPointerDeathTest  )

◆ TEST() [12/23]

container::TEST ( Tensor ,
GetValueAndInnerMostPtr  )

◆ TEST() [13/23]

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

◆ TEST() [14/23]

container::TEST ( Tensor ,
OutputOperator  )

◆ TEST() [15/23]

container::TEST ( Tensor ,
Reshape  )

◆ TEST() [16/23]

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

◆ TEST() [17/23]

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

◆ TEST() [18/23]

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

◆ TEST() [19/23]

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

◆ TEST() [20/23]

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

◆ TEST() [21/23]

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

◆ TEST() [22/23]

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

◆ TEST() [23/23]

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

◆ TEST_F()

container::TEST_F ( TensorAccessorTest ,
TensorAccessorTest  )