Column-oriented GPU-accelerated Database Management System
CoGaDB
/home/sebastian/gpudbms/trunk/cogadb/include/core/gpu_column_cache.hpp
Go to the documentation of this file.
00001 #pragma once
00002 #include <core/base_column.hpp>
00003 #include <gpu/gpu_algorithms.hpp>
00004 #include <utility>
00005 #include <map>
00006 
00007 namespace CoGaDB{
00008 
00009         class GPU_Column_Cache{
00010                 public:
00011                 typedef std::map<ColumnPtr,gpu::GPU_Base_ColumnPtr> Map;
00012 
00013 
00014                 /* \brief if GPU column already exists, then return pointer to it, otherwise create new GPU column by transferring the data the GPU memory
00015                         \detail if the GPU Buffer is full, then delete least recently used Column*/
00016                 const gpu::GPU_Base_ColumnPtr getGPUColumn(ColumnPtr);
00017 
00018                 static GPU_Column_Cache& instance();
00019 
00020                 void printStatus() const throw();
00021 
00022                 bool removeGPUColumn(gpu::GPU_Base_ColumnPtr);
00023 
00024                 private:
00025                 GPU_Column_Cache(unsigned int max_gpu_buffer_size_in_byte); //no constructor call outside of this class
00026                 GPU_Column_Cache(const GPU_Column_Cache&); //no copy constructor
00027                 GPU_Column_Cache& operator=(const GPU_Column_Cache&); //nocopy assignment
00028                 Map map_;
00029                 unsigned int max_gpu_buffer_size_in_byte_;
00030                 bool caching_enabled_;
00031         };
00032 
00033 }; //end namespace CoGaDB
00034 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines