OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InValuesBitmap.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, 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 
23 #ifndef QUERYENGINE_INVALUESBITMAP_H
24 #define QUERYENGINE_INVALUESBITMAP_H
25 
26 #include "../DataMgr/DataMgr.h"
27 
28 #include <llvm/IR/Value.h>
29 
30 #include <cstdint>
31 #include <stdexcept>
32 #include <vector>
33 
34 class Executor;
35 
36 class FailedToCreateBitmap : public std::runtime_error {
37  public:
38  FailedToCreateBitmap() : std::runtime_error("FailedToCreateBitmap") {}
39 };
40 
42  public:
43  InValuesBitmap(const std::vector<int64_t>& values,
44  const int64_t null_val,
45  const Data_Namespace::MemoryLevel memory_level,
46  const int device_count,
47  Data_Namespace::DataMgr* data_mgr);
49 
50  llvm::Value* codegen(llvm::Value* needle, Executor* executor) const;
51 
52  bool isEmpty() const;
53 
54  bool hasNull() const;
55 
56  size_t gpuBuffers() const { return gpu_buffers_.size(); }
57 
58  private:
59  std::vector<Data_Namespace::AbstractBuffer*> gpu_buffers_;
60  std::vector<int8_t*> bitsets_;
62  int64_t min_val_;
63  int64_t max_val_;
64  const int64_t null_val_;
66  const int device_count_;
68 };
69 
70 #endif // QUERYENGINE_INVALUESBITMAP_H
bool hasNull() const
size_t gpuBuffers() const
std::vector< int8_t * > bitsets_
std::vector< Data_Namespace::AbstractBuffer * > gpu_buffers_
InValuesBitmap(const std::vector< int64_t > &values, const int64_t null_val, const Data_Namespace::MemoryLevel memory_level, const int device_count, Data_Namespace::DataMgr *data_mgr)
const int64_t null_val_
Executor(const ExecutorId id, Data_Namespace::DataMgr *data_mgr, 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:272
llvm::Value * codegen(llvm::Value *needle, Executor *executor) const
Data_Namespace::DataMgr * data_mgr_
const int device_count_
bool isEmpty() const
const Data_Namespace::MemoryLevel memory_level_