OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TableFunctionOps.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2021 OmniSci, 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 #ifdef EXECUTE_INCLUDE
18 
20 
21 /*
22  set_output_row_size sets the row size of output Columns and
23  allocates the corresponding column buffers.
24 
25  `set_output_row_size` can be called exactly one time when entering a
26  table function (when not using TableFunctionSpecifiedParameter
27  sizer) or within a table function (when using
28  TableFunctionSpecifiedParameter sizer).
29 */
30 extern "C" DEVICE RUNTIME_EXPORT void set_output_row_size(int64_t num_rows) {
32  CHECK(mgr != nullptr); // failure means that set_output_row_size
33  // is called out-of-scope of
34  // QueryOutputBufferMemoryManager usage
35  CHECK_GE(num_rows, 0);
36  mgr->allocate_output_buffers(num_rows);
37 }
38 
39 /*
40  register_output_column stores the pointer of output Column instance
41  so that when the buffers of output columns are allocated, the Column
42  instance members ptr_ and size_ can be updated.
43 
44  register_output_column is used internally when creating output
45  Column instances prior entering the table function.
46  */
47 extern "C" DEVICE RUNTIME_EXPORT void register_output_column(int32_t index, int8_t* ptr) {
49  CHECK(mgr);
50  mgr->set_output_column(index, ptr);
51 }
52 
53 #endif // EXECUTE_INCLUDE
#define CHECK_GE(x, y)
Definition: Logger.h:219
static QueryOutputBufferMemoryManager *& get_singleton()
#define DEVICE
EXTENSION_NOINLINE void set_output_row_size(int64_t num_rows)
#define RUNTIME_EXPORT
#define CHECK(condition)
Definition: Logger.h:206