8 #if defined(__cplusplus) && !defined(MSC_VER) 12 #if defined(__cplusplus) && !defined(MSC_VER) 20 : free_mzd(),free_clmatrix()
51 if (! free_list.empty()) {
52 result = free_list.back();
56 result =
new_mzd(rows, cols,
nullptr);
61 Q_ASSERT(result->nrows == rows);
62 Q_ASSERT(result->ncols == cols);
71 if (! free_list.empty()) {
72 result = free_list.back();
79 Q_ASSERT(result->
nrows == rows);
80 Q_ASSERT(result->
ncols == cols);
86 free_list.push_back(M);
91 free_list.push_back(M);
97 for(mzd_t* M : i.second)
113 return mzd_init(rows,cols);
void clm4rm_zero_fill(clmatrix_t *gpu_matrix, cl_command_queue queue, clm4rm_conditions *cond)
Fill a matrix with zero data. The operation is scheduled for asynchronous execution of the GPU....
clmatrix_t * new_clmatrix(int rows, int cols, MatrixPool *pool, clm4rm_conditions *cond)
allocate a new clmatrix_t structure (a matrix for the CLM4RM algorithms)
OpenCL boolean matrix data structure. Data is arranged in 32 bit words.
mzdMap free_mzd
set of recyclable mzd_t objects
void clm4rm_free(clmatrix_t *gpu_matrix)
release memory (CPU and GPU)
std::pair< int, int > Key
global definitions for all algorithms.
MatrixPool()
empty constructor
std::list< mzd_t * > mzdList
clmatrix_t * new_clmatrix_t(int rows, int cols, clm4rm_conditions *cond)
allocate a new clmatrix_t structure (a matrix for the CLM4RM algorithms)
Manages OpenCL event dependencies; necessary when the queue is out-of-order; dependencies must be est...
mzd_t * new_mzd(int rows, int cols, MatrixPool *pool)
allocate a new mzd_t structure (a matrix for the M4RI algorithms)
rci_t ncols
Number of columns.
void clear()
release all resources
std::list< clmatrix_t * > clmatrixList
clmatrix_t * clm4rm_create(rci_t rows, rci_t cols, int rowpadding, int read_only, cl_context ctx)
create an empty matrix
mzd_t * new_mzd_t(int rows, int cols)
allocate a new mzd_t structure (a matrix for the M4RI algorithms)
clmatrixList & getClmatrixFreeList(int rows, int cols)
memory pool for matrix objects (M4RI matrices mzd_t* and OpenCL matrices clm4rm_t*)
void reclaim(mzd_t *m, MatrixPool *pool)
reclaim an object (i.e. put it into the recycling list)
~MatrixPool()
destructor; releases all resources
clmatrixMap free_clmatrix
set of recyclable clmatrix_t objects
void reclaim(mzd_t *)
reclaim an object (i.e. put it into the recycling list)
rci_t nrows
Number of rows.
static cl_context clContext()
static cl_command_queue clQueue()
mzdList & getMzdFreeList(int rows, int cols)