ConvNet  1.0
A GPU-based C++ implementation of Convolutional Neural Nets
 All Classes Namespaces Functions Variables
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Matrix Class Reference

A GPU matrix class. More...

#include <matrix.h>

Public Member Functions

 Matrix (const int rows, const int cols, const bool on_gpu)
 
void Tie (Matrix &m)
 
void AllocateGPUMemory (const int rows, const int cols, const string &name)
 
void AllocateGPUMemory (const int rows, const int cols)
 
void AllocateMainMemory (const int rows, const int cols)
 
void Set (const float val)
 
void Set (Matrix &val)
 
void GetSlice (Matrix &slice, int start, int end)
 
void FillWithRand ()
 
void FillWithRandn ()
 
void CopyToHost ()
 
void CopyToDevice ()
 
void CopyToDeviceSlice (const int start, const int end)
 
void CopyToHostSlice (const int start, const int end)
 
void CopyFromMainMemory (Matrix &mat)
 
void Reshape (const int rows, const int cols)
 
float Norm ()
 
void Print ()
 
void WriteToFile (FILE *file)
 
void ReadFromFile (FILE *file)
 
void WriteHDF5 (hid_t file, const string &name)
 
void ReadHDF5 (hid_t file, const string &name)
 
void AllocateAndReadHDF5 (hid_t file, const string &name)
 
string GetShapeString ()
 
cudamatGetMat ()
 
cudamatGetMatTranspose ()
 
float * GetHostData ()
 
int GetRows () const
 
int GetCols () const
 
int GetNumEls () const
 
float Sum ()
 
void Add (Matrix &m)
 
void SquashRelu ()
 
int GetGPUId () const
 
void SetReady ()
 
void WaitTillReady ()
 

Static Public Member Functions

static void GetOnes (int rows, int cols, Matrix &ones)
 
static void RegisterTempMemory (int size)
 
static void RegisterTempMemory (int size, const string &why)
 
static void RegisterOnes (int size)
 
static void GetTemp (int rows, int cols, Matrix &temp)
 
static void InitRandom (int seed)
 
static void SetupCUDADevice (int gpu_id)
 
static void SetupCUDADevices (const vector< int > &boards)
 
static void SetDevice (int gpu_id)
 
static void SyncAllDevices ()
 
static int GetDevice ()
 
static int GetNumBoards ()
 

Static Public Attributes

static vector< Matrixones_
 
static vector< Matrixtemp_
 
static vector< rnd_structrnd_
 

Detailed Description

A GPU matrix class.


The documentation for this class was generated from the following files: