OmniSciDB  dfae7c3b14
InValuesBitmap.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * @file InValuesBitmap.h
19  * @author Alex Suhan <alex@mapd.com>
20  *
21  * Copyright (c) 2015 MapD Technologies, Inc. All rights reserved.
22  */
23 
24 #ifndef QUERYENGINE_INVALUESBITMAP_H
25 #define QUERYENGINE_INVALUESBITMAP_H
26 
27 #include "../DataMgr/DataMgr.h"
28 
29 #include <llvm/IR/Value.h>
30 
31 #include <cstdint>
32 #include <stdexcept>
33 #include <vector>
34 
35 class Executor;
36 
37 class FailedToCreateBitmap : public std::runtime_error {
38  public:
39  FailedToCreateBitmap() : std::runtime_error("FailedToCreateBitmap") {}
40 };
41 
43  public:
44  InValuesBitmap(const std::vector<int64_t>& values,
45  const int64_t null_val,
46  const Data_Namespace::MemoryLevel memory_level,
47  const int device_count,
48  Data_Namespace::DataMgr* data_mgr);
49  ~InValuesBitmap();
50 
51  llvm::Value* codegen(llvm::Value* needle, Executor* executor) const;
52 
53  bool isEmpty() const;
54 
55  bool hasNull() const;
56 
57  size_t gpuBuffers() const { return gpu_buffers_.size(); }
58 
59  private:
60  std::vector<Data_Namespace::AbstractBuffer*> gpu_buffers_;
61  std::vector<int8_t*> bitsets_;
63  int64_t min_val_;
64  int64_t max_val_;
65  const int64_t null_val_;
67  const int device_count_;
69 };
70 
71 #endif // QUERYENGINE_INVALUESBITMAP_H
std::vector< int8_t * > bitsets_
std::vector< Data_Namespace::AbstractBuffer * > gpu_buffers_
const int64_t null_val_
Data_Namespace::DataMgr * data_mgr_
const int device_count_
Executor(const ExecutorId id, const size_t block_size_x, const size_t grid_size_x, const size_t max_gpu_slab_size, const std::string &debug_dir, const std::string &debug_file)
Definition: Execute.cpp:131
size_t gpuBuffers() const
const Data_Namespace::MemoryLevel memory_level_