OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RowFunctionOps.cpp
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 #ifdef EXECUTE_INCLUDE
18 
20 
21 DEVICE RUNTIME_EXPORT std::string RowFunctionManager_getString(int8_t* mgr_ptr,
22  int32_t db_id,
23  int32_t dict_id,
24  int32_t string_id) {
25  auto mgr = reinterpret_cast<RowFunctionManager*>(mgr_ptr);
26  CHECK(mgr);
27  return mgr->getString(db_id, dict_id, string_id);
28 }
29 
30 extern "C" DEVICE RUNTIME_EXPORT int8_t* RowFunctionManager_getStringDictionaryProxy(
31  int8_t* mgr_ptr,
32  int32_t db_id,
33  int32_t dict_id) {
34  auto mgr = reinterpret_cast<RowFunctionManager*>(mgr_ptr);
35  CHECK(mgr);
36  return mgr->getStringDictionaryProxy(db_id, dict_id);
37 }
38 
39 extern "C" DEVICE RUNTIME_EXPORT int32_t
40 RowFunctionManager_getDictDbId(int8_t* mgr_ptr, const char* func_name, size_t index) {
41  auto mgr = reinterpret_cast<RowFunctionManager*>(mgr_ptr);
42  CHECK(mgr);
43  return mgr->getDictDbId(std::string(func_name), index);
44 }
45 
46 extern "C" DEVICE RUNTIME_EXPORT int32_t
47 RowFunctionManager_getDictId(int8_t* mgr_ptr, const char* func_name, size_t index) {
48  auto mgr = reinterpret_cast<RowFunctionManager*>(mgr_ptr);
49  CHECK(mgr);
50  return mgr->getDictId(std::string(func_name), index);
51 }
52 
53 extern "C" DEVICE RUNTIME_EXPORT int32_t
55  int32_t db_id,
56  int32_t dict_id,
57  std::string str) {
58  auto mgr = reinterpret_cast<RowFunctionManager*>(mgr_ptr);
59  CHECK(mgr);
60  return mgr->getOrAddTransient(db_id, dict_id, str);
61 }
62 
64  int8_t* mgr_ptr,
65  int64_t element_count,
66  int64_t element_size) {
67  auto mgr = reinterpret_cast<RowFunctionManager*>(mgr_ptr);
68  CHECK(mgr);
69  return mgr->makeBuffer(element_count, element_size);
70 }
71 
72 #endif // #ifdef EXECUTE_INCLUDE
EXTENSION_NOINLINE_HOST int32_t RowFunctionManager_getDictDbId(int8_t *mgr_ptr, const char *func_name, size_t arg_idx)
EXTENSION_NOINLINE_HOST int32_t RowFunctionManager_getDictId(int8_t *mgr_ptr, const char *func_name, size_t arg_idx)
EXTENSION_NOINLINE_HOST int32_t RowFunctionManager_getOrAddTransient(int8_t *mgr_ptr, int32_t db_id, int32_t dict_id, std::string str)
EXTENSION_NOINLINE_HOST int8_t * RowFunctionManager_makeBuffer(int8_t *mgr_ptr, int64_t count, int64_t size)
#define DEVICE
#define RUNTIME_EXPORT
RUNTIME_EXPORT NEVER_INLINE HOST std::string RowFunctionManager_getString(int8_t *mgr_ptr, int32_t db_id, int32_t dict_id, int32_t string_id)
#define CHECK(condition)
Definition: Logger.h:291