24 #ifndef KALDI_CUDAMATRIX_CU_ARRAY_H_ 25 #define KALDI_CUDAMATRIX_CU_ARRAY_H_ 75 void CopyToVec(std::vector<T> *dst)
const;
87 void Set(
const T &value);
95 void Add(
const T &value);
134 { Resize(dim, resize_type); }
173 void Read(std::istream &is,
bool binary);
174 void Write(std::ostream &is,
bool binary)
const;
192 this->
data_ =
const_cast<T*
>(data);
201 std::ostream &operator << (std::ostream &out, const CuArray<T> &vec);
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
T Min() const
Get minimum value (for now implemented on CPU, reimplement if slow).
void CopyToVec(std::vector< T > *dst) const
This function resizes *dst if needed.
const T * Data() const
Get raw pointer.
void CopyFromArray(const CuArrayBase< T > &src)
The caller is responsible to ensure dim is equal between *this and src.
void Add(const T &value)
Add a constant value.
T * data_
GPU data pointer (if GPU not available, will point to CPU memory).
void Set(const T &value)
Set to a constant value.
void CopyToHost(T *dst) const
Version of the above function that copies contents to a host array (i.e.
MatrixIndexT dim_
dimension of the vector
CuSubArray(const T *data, MatrixIndexT length)
Construct from raw pointers.
Class CuArrayBase, CuSubArray and CuArray are analogues of classes CuVectorBase, CuSubVector and CuVe...
Class CuArray represents a vector of an integer or struct of type T.
void CopyFromVec(const std::vector< T > &src)
The caller is responsible to ensure dim is equal between *this and src.
void SetZero()
Sets the memory for the object to zero, via memset.
void Sequence(const T base)
Fill with the sequence [base ...
T Max() const
Get minimum value (for now implemented on CPU, reimplement if slow).
MatrixIndexT Dim() const
Return the vector dimension.