cuda_mem_pool Class Reference

#include <cuda_mem_pool.hh>

Inheritance diagram for cuda_mem_pool:
Inheritance graph
[legend]
Collaboration diagram for cuda_mem_pool:
Collaboration graph
[legend]

Public Member Functions

virtual bool init (unsigned long maxsize)
virtual void destroy ()

Detailed Description

class cuda_mem_pool

memory pool for device memory.


Member Function Documentation

void cuda_mem_pool::destroy (  )  [virtual]

Free allocated memory.

00024 {
00025         if (mem_) {
00026                 cutilSafeCall(cudaFree(mem_));
00027                 mem_ = NULL;
00028         }
00029 }

bool cuda_mem_pool::init ( unsigned long  maxsize  )  [virtual]

Allocate the pool buffer in the device memory.

Parameters:
maxsize Total amount of buffer for the pool.
Returns:
true if successful, false otherwise.

Implements mem_pool.

00016 {
00017         maxsize_ = maxsize;
00018         cutilSafeCall(cudaMalloc((void**)&mem_, maxsize));
00019         return true;
00020 }

 All Data Structures Functions
Generated on Tue Oct 18 10:20:20 2011 for libgpucrypto by  doxygen 1.6.3