Column-oriented GPU-accelerated Database Management System
CoGaDB
|
00001 #pragma once 00002 00003 #include <core/global_definitions.hpp> 00004 #include <gpu/gpu_base_column.hpp> 00005 00006 namespace CoGaDB{ 00007 00008 //template <typename T> 00009 //const std::vector<unsigned int> gpu_sort(std::vector<T> values_in_column); 00010 00011 int CUDA_device_check(int gpudevice); 00012 00013 int check_for_CUDA_devices(); 00014 00015 unsigned int getNumberofGPUMultiprocessors(); 00016 00017 unsigned int getTotalGPUMemorySizeInByte(); 00018 00019 unsigned int getFreeGPUMemorySizeInByte(); 00020 00021 void printGPUStatus(); 00022 00023 const std::vector<std::pair<unsigned int,unsigned int> > gpu_join_tids(std::vector<int>& join_column1, std::vector<int>& join_column2); 00024 00025 //template <typename T> 00026 //const std::vector<unsigned int> gpu_selection_tids(const std::vector<T>& column, T value, ValueComparator comp); 00027 00028 namespace gpu{ 00029 00030 class GPU_Operators{ 00031 public: 00032 /***************** relational operations on Columns which return lookup tables *****************/ 00033 static const GPU_PositionlistPtr sort(GPU_Base_ColumnPtr device_column, SortOrder order); 00034 static const GPU_PositionlistPtr selection(GPU_Base_ColumnPtr column, const boost::any& value_for_comparison, const ValueComparator comp); 00035 //join algorithms 00036 // static const std::pair<GPU_Positionlist*,GPU_Positionlist*> gpu_join(GPU_Base_Column* join_column1, GPU_Base_Column* join_column2, JoinAlgorithm join_alg); 00037 static const std::pair<GPU_Base_ColumnPtr,GPU_Base_ColumnPtr> groupby(GPU_Base_ColumnPtr grouping_column, 00038 GPU_Base_ColumnPtr aggregation_column, 00039 AggregationMethod agg_meth=SUM); 00040 00041 static const GPU_Base_ColumnPtr materializeIntermediateResult(GPU_Base_ColumnPtr column, GPU_PositionlistPtr pos_list); 00042 00043 static const std::pair<GPU_PositionlistPtr,GPU_PositionlistPtr> hash_join(GPU_Base_ColumnPtr join_column1, GPU_Base_ColumnPtr join_column2); 00044 static const std::pair<GPU_PositionlistPtr,GPU_PositionlistPtr> sort_merge_join(GPU_Base_ColumnPtr join_column1, GPU_Base_ColumnPtr join_column2); 00045 static const std::pair<GPU_PositionlistPtr,GPU_PositionlistPtr> nested_loop_join(GPU_Base_ColumnPtr join_column1, GPU_Base_ColumnPtr join_column2); 00046 }; 00047 00048 // #ifdef __CUDACC__ 00049 // class GPU_Base_Column{}; 00050 // #endif 00051 00052 }; //end namespace gpu 00053 }; //end namespace CogaDB 00054