OmniSciDB  04ee39c94c
TopKSort.h
Go to the documentation of this file.
1 /* copyright 2017 MapD Technologies, Inc.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef QUERYENGINE_TOPKSORT_H
16 #define QUERYENGINE_TOPKSORT_H
17 
18 #ifdef HAVE_CUDA
19 #include <cuda.h>
20 #include "../Shared/sqltypes.h"
21 #include "ResultSetSortImpl.h"
22 
23 #include <vector>
24 
25 namespace Data_Namespace {
26 
27 class DataMgr;
28 
29 } // namespace Data_Namespace
30 
31 class ThrustAllocator;
32 
33 std::vector<int8_t> pop_n_rows_from_merged_heaps_gpu(
34  Data_Namespace::DataMgr* data_mgr,
35  const int64_t* dev_heaps,
36  const size_t heaps_size,
37  const size_t n,
38  const PodOrderEntry& oe,
39  const GroupByBufferLayoutInfo& layout,
40  const size_t group_key_bytes,
41  const size_t thread_count,
42  const int device_id);
43 
44 #endif // HAVE_CUDA
45 
46 #endif // QUERYENGINE_TOPKSORT_H