Loading [MathJax]/extensions/tex2jax.js
cuML C++ API  23.12
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Public Attributes | List of all members
ML::SimpleSparseMat< T > Struct Template Reference

#include <sparse.hpp>

Inheritance diagram for ML::SimpleSparseMat< T >:
Inheritance graph
Collaboration diagram for ML::SimpleSparseMat< T >:
Collaboration graph

Public Types

typedef SimpleMat< T > Super
 

Public Member Functions

 SimpleSparseMat ()
 
 SimpleSparseMat (T *values, int *cols, int *row_ids, int nnz, int m, int n)
 
void print (std::ostream &oss) const override
 
void operator= (const SimpleSparseMat< T > &other)=delete
 
void gemmb (const raft::handle_t &handle, const T alpha, const SimpleDenseMat< T > &A, const bool transA, const bool transB, const T beta, SimpleDenseMat< T > &C, cudaStream_t stream) const override
 
- Public Member Functions inherited from ML::SimpleMat< T >
 SimpleMat (int m, int n)
 
void operator= (const SimpleMat< T > &other)=delete
 

Public Attributes

T * values
 
int * cols
 
int * row_ids
 
int nnz
 
- Public Attributes inherited from ML::SimpleMat< T >
int m
 
int n
 

Detailed Description

template<typename T>
struct ML::SimpleSparseMat< T >

Sparse matrix in CSR format.

Note, we use cuSPARSE to manimulate matrices, and it guarantees:

  1. row_ids[m] == nnz
  2. cols are sorted within rows.

However, when the data comes from the outside, we cannot guarantee that.

Member Typedef Documentation

◆ Super

template<typename T >
typedef SimpleMat<T> ML::SimpleSparseMat< T >::Super

Constructor & Destructor Documentation

◆ SimpleSparseMat() [1/2]

template<typename T >
ML::SimpleSparseMat< T >::SimpleSparseMat ( )
inline

◆ SimpleSparseMat() [2/2]

template<typename T >
ML::SimpleSparseMat< T >::SimpleSparseMat ( T *  values,
int *  cols,
int *  row_ids,
int  nnz,
int  m,
int  n 
)
inline

Member Function Documentation

◆ gemmb()

template<typename T >
void ML::SimpleSparseMat< T >::gemmb ( const raft::handle_t &  handle,
const T  alpha,
const SimpleDenseMat< T > &  A,
const bool  transA,
const bool  transB,
const T  beta,
SimpleDenseMat< T > &  C,
cudaStream_t  stream 
) const
inlineoverridevirtual

GEMM assigning to C where this refers to B.

C <- alpha * A^transA * (*this)^transB + beta * C

Implements ML::SimpleMat< T >.

◆ operator=()

template<typename T >
void ML::SimpleSparseMat< T >::operator= ( const SimpleSparseMat< T > &  other)
delete

◆ print()

template<typename T >
void ML::SimpleSparseMat< T >::print ( std::ostream &  oss) const
inlineoverridevirtual

Implements ML::SimpleMat< T >.

Member Data Documentation

◆ cols

template<typename T >
int* ML::SimpleSparseMat< T >::cols

◆ nnz

template<typename T >
int ML::SimpleSparseMat< T >::nnz

◆ row_ids

template<typename T >
int* ML::SimpleSparseMat< T >::row_ids

◆ values

template<typename T >
T* ML::SimpleSparseMat< T >::values

The documentation for this struct was generated from the following file: