OmniSciDB  b28c0d5765
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RenderInfo.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 
17 #pragma once
18 
19 #include "Analyzer/Analyzer.h"
20 #include "Catalog/Catalog.h"
25 
26 namespace QueryRenderer {
27 struct RenderSessionKey;
28 }
29 
31  public:
32  std::unique_ptr<RenderAllocatorMap> render_allocator_map_ptr;
33  const ::QueryRenderer::RenderSessionKey& render_session_key;
34 
35  // Info for all the column targets retrieved in in a query. Used to extract column/table
36  // info when rendering.
37  std::vector<std::shared_ptr<Analyzer::TargetEntry>> targets;
38 
39  // All the "selected from" tables in a query. Includes resolved and un-resolved views.
40  std::unordered_set<std::string> table_names;
41 
42  RenderInfo(const ::QueryRenderer::RenderSessionKey& in_render_session_key,
43  const RenderQueryOptions& in_render_query_opts,
44  const heavyai::InSituFlags in_insitu_flags = heavyai::InSituFlags::kInSitu);
45 
47  std::shared_ptr<Catalog_Namespace::SessionInfo const> getSessionInfoPtr() const;
48 
49  void forceNonInSitu();
50  void setNonInSitu();
51 
52  bool useCudaBuffers() const;
53  void disableCudaBuffers();
54 
55  std::shared_ptr<QueryRenderer::QueryDataLayout> getQueryVboLayout() const;
56  void setQueryVboLayout(
57  const std::shared_ptr<QueryRenderer::QueryDataLayout>& vbo_layout);
58  std::shared_ptr<QueryRenderer::QueryDataLayout> getQuerySsboLayout() const;
59  void setQuerySsboLayout(
60  const std::shared_ptr<QueryRenderer::QueryDataLayout>& ssbo_layout);
61 
63 
64  bool setInSituDataIfUnset(const bool is_in_situ_data);
65 
66  void reset(std::unique_ptr<RenderQueryOptions> in_query_opts,
67  const bool in_force_non_in_situ_data);
68 
69  private:
72  in_situ_data; // Should be set to true if query results can be written directly to
73  // CUDA-mapped buffers for rendering. Should be set to false
74  // otherwise, meaning results are written to CPU first, and buffered
75  // back to GPU for rendering. An alternative meaning is that when
76  // false, you've encountered a non-projection query. Can only be set
77  // once for the lifetime of the object.
80 
81  std::shared_ptr<QueryRenderer::QueryDataLayout> query_vbo_layout;
82  std::shared_ptr<QueryRenderer::QueryDataLayout> query_ssbo_layout;
84 };
Defines data structures for the semantic analysis phase of query processing.
void disableCudaBuffers()
Definition: RenderInfo.cpp:58
const ::QueryRenderer::RenderSessionKey & render_session_key
Definition: RenderInfo.h:33
RenderInfo(const ::QueryRenderer::RenderSessionKey &in_render_session_key, const RenderQueryOptions &in_render_query_opts, const heavyai::InSituFlags in_insitu_flags=heavyai::InSituFlags::kInSitu)
Definition: RenderInfo.cpp:20
bool useCudaBuffers() const
Definition: RenderInfo.cpp:53
std::shared_ptr< Catalog_Namespace::SessionInfo const > getSessionInfoPtr() const
Definition: RenderInfo.cpp:39
void forceNonInSitu()
Definition: RenderInfo.cpp:45
std::shared_ptr< QueryRenderer::QueryDataLayout > getQuerySsboLayout() const
Definition: RenderInfo.cpp:72
std::vector< std::shared_ptr< Analyzer::TargetEntry > > targets
Definition: RenderInfo.h:37
bool setInSituDataIfUnset(const bool is_in_situ_data)
const Catalog_Namespace::SessionInfo & getSessionInfo() const
Definition: RenderInfo.cpp:29
std::unordered_set< std::string > table_names
Definition: RenderInfo.h:40
This file contains the class specification and related data structures for Catalog.
const RenderQueryOptions & getRenderQueryOptions() const
Definition: RenderInfo.cpp:82
std::shared_ptr< QueryRenderer::QueryDataLayout > getQueryVboLayout() const
Definition: RenderInfo.cpp:62
InSituState in_situ_data
Definition: RenderInfo.h:72
RenderQueryOptions render_query_opts_
Definition: RenderInfo.h:83
void reset(std::unique_ptr< RenderQueryOptions > in_query_opts, const bool in_force_non_in_situ_data)
Definition: RenderInfo.cpp:87
std::shared_ptr< QueryRenderer::QueryDataLayout > query_ssbo_layout
Definition: RenderInfo.h:82
bool force_non_in_situ_data
Definition: RenderInfo.h:78
void setNonInSitu()
Definition: RenderInfo.cpp:49
bool cuda_using_buffers_
Definition: RenderInfo.h:79
std::unique_ptr< RenderAllocatorMap > render_allocator_map_ptr
Definition: RenderInfo.h:32
void setQuerySsboLayout(const std::shared_ptr< QueryRenderer::QueryDataLayout > &ssbo_layout)
Definition: RenderInfo.cpp:77
void setQueryVboLayout(const std::shared_ptr< QueryRenderer::QueryDataLayout > &vbo_layout)
Definition: RenderInfo.cpp:67
std::shared_ptr< QueryRenderer::QueryDataLayout > query_vbo_layout
Definition: RenderInfo.h:81