Column-oriented GPU-accelerated Database Management System
CoGaDB
|
00001 /*********************************************************************************************************** 00002 Copyright (c) 2013, Sebastian Breß, Otto-von-Guericke University of Magdeburg, Germany. All rights reserved. 00003 00004 This program and accompanying materials are made available under the terms of the 00005 GNU LESSER GENERAL PUBLIC LICENSE - Version 3, http://www.gnu.org/licenses/lgpl-3.0.txt 00006 ***********************************************************************************************************/ 00007 #pragma once 00008 00009 #include <stdlib.h> 00010 #include <stdio.h> 00011 #include <stdint.h> 00012 00013 #include <config/global_definitions.hpp> 00014 00015 //#define NDEBUG //uncomment for release version 00016 #include <assert.h> 00017 00018 #ifdef __cplusplus 00019 using namespace hype; 00020 extern "C" { 00021 #endif 00022 00023 00024 //enum C_ComputeDevice {CPU,GPU,FPGA,NP}; //CPU,GPU,FPGA, Network Processor 00025 00026 /*#############################################################################*/ 00027 /************************* Scheduling Decision ******************************/ 00028 00029 /*#############################################################################*/ 00030 00031 typedef struct C_SchedulingDecision { 00032 void* ptr; //=NULL; 00033 } C_SchedulingDecision; 00034 00035 char* hype_SchedulingDecision_getAlgorithmName(C_SchedulingDecision* sched_dec); 00036 00037 ProcessingDeviceID hype_SchedulingDecision_getProcessingDeviceID(C_SchedulingDecision* sched_dec); 00038 00039 int hype_deleteSchedulingDecision(C_SchedulingDecision* sched_dec); 00040 00041 /*#############################################################################*/ 00042 /************************* Algorithm Specification ******************************/ 00043 00044 /*#############################################################################*/ 00045 00046 typedef struct C_AlgorithmSpecification { 00047 void* ptr; 00048 } C_AlgorithmSpecification; 00049 00057 C_AlgorithmSpecification* hype_createAlgorithmSpecification(const char* alg_name, 00058 const char* op_name, 00059 StatisticalMethod stat_meth, 00060 RecomputationHeuristic recomp_heur, 00061 OptimizationCriterion opt_crit); 00062 00063 int hype_deleteAlgorithmSpecification(C_AlgorithmSpecification* alg_spec); 00064 00065 /*#############################################################################*/ 00066 /************************* Device Specification ******************************/ 00067 00068 /*#############################################################################*/ 00069 00070 typedef struct C_DeviceSpecification { 00071 void* ptr; 00072 } C_DeviceSpecification; 00073 00079 C_DeviceSpecification* hype_createDeviceSpecification(ProcessingDeviceID pd, 00080 ProcessingDeviceType pd_t, 00081 ProcessingDeviceMemoryID pd_m); 00082 00083 int hype_deleteDeviceSpecification(C_DeviceSpecification* dev_spec); 00084 00085 /*#############################################################################*/ 00086 /************************* Operator Specification ******************************/ 00087 00088 /*#############################################################################*/ 00089 00090 00091 typedef struct C_OperatorSpecification { 00092 void* ptr; 00093 } C_OperatorSpecification; 00094 00102 C_OperatorSpecification* hype_create_OperatorSpecification(const char* operator_name, 00103 double* feature_vector, 00104 size_t feature_vector_length, 00105 ProcessingDeviceMemoryID location_of_input_data, 00106 ProcessingDeviceMemoryID location_for_output_data); 00107 00108 int hype_deleteOperatorSpecification(C_OperatorSpecification* op_spec); 00109 00110 /*#############################################################################*/ 00111 /************************* Device Constraints *********************************/ 00112 00113 /*#############################################################################*/ 00114 00115 typedef struct C_DeviceConstraint { 00116 void* ptr; 00117 } C_DeviceConstraint; 00118 00123 C_DeviceConstraint* hype_createDeviceConstraint(DeviceTypeConstraint dev_constr, 00124 ProcessingDeviceMemoryID pd_mem_constr); 00125 00126 int hype_deleteDeviceConstraint(C_DeviceConstraint* dev_const); 00127 00128 00129 /*#############################################################################*/ 00130 /************************* Scheduler functions *********************************/ 00131 /*#############################################################################*/ 00132 00140 int hype_addAlgorithm(const C_AlgorithmSpecification* alg_spec, const C_DeviceSpecification* dev_spec); 00141 00147 int hype_setOptimizationCriterion(const char* name_of_operation, 00148 const char* name_of_optimization_criterion); 00154 int hype_setStatisticalMethod(const char* name_of_algorithm, 00155 const char* name_of_statistical_method); 00161 int hype_setRecomputationHeuristic(const char* name_of_algorithm, 00162 const char* name_of_recomputation_strategy); 00169 C_SchedulingDecision* hype_getOptimalAlgorithm(const C_OperatorSpecification* op_spec, const C_DeviceConstraint* dev_constr); 00175 int hype_addObservation(const C_SchedulingDecision* sched_dec, const double measured_execution_time); 00176 /* \brief request an Estimated Execution Time from HyPE for an algorithm for a certain operator 00177 * \param op_spec OperatorSpecification, contains all available information about the operator to execute 00178 * \param alg_name algorithm name 00179 * \return estimated execution time 00180 */ 00181 double hype_getEstimatedExecutionTime(const C_OperatorSpecification* op_spec, const char* alg_name); 00182 00183 /*#############################################################################*/ 00184 /************************* Util functions *********************************/ 00185 /*#############################################################################*/ 00186 uint64_t hype_getTimestamp(); 00187 void hype_printStatus(); 00188 00189 #ifdef __cplusplus 00190 } 00191 #endif