OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UDFCompiler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 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 
25 #ifndef UDF_COMPILER_H
26 #define UDF_COMPILER_H
27 
28 #include <string>
29 #include <vector>
30 
31 class UdfCompiler {
32  public:
33  UdfCompiler(const std::string&);
34  int compileUdf();
35  const std::string& getAstFileName() const;
36 
37  private:
38  std::string removeFileExtension(const std::string& path);
39  std::string getFileExt(std::string& s);
40  int parseToAst(const char* file_name);
41  std::string genGpuIrFilename(const char* udf_file_name);
42  std::string genCpuIrFilename(const char* udf_file_name);
43  int compileToGpuByteCode(const char* udf_file_name, bool cpu_mode);
44  int compileToCpuByteCode(const char* udf_file_name);
45  void replaceExtn(std::string& s, const std::string& new_ext);
46  int compileFromCommandLine(std::vector<const char*>& command_line);
47  void readCompiledModules();
48  void readGpuCompiledModule();
49  void readCpuCompiledModule();
50  int compileForGpu();
51 
52  private:
53  std::string udf_file_name_;
54  std::string udf_ast_file_name_;
55 };
56 #endif
std::string genCpuIrFilename(const char *udf_file_name)
int compileToCpuByteCode(const char *udf_file_name)
void readCompiledModules()
UdfCompiler(const std::string &)
const std::string & getAstFileName() const
void readCpuCompiledModule()
std::string genGpuIrFilename(const char *udf_file_name)
std::string removeFileExtension(const std::string &path)
int compileToGpuByteCode(const char *udf_file_name, bool cpu_mode)
std::string udf_ast_file_name_
Definition: UDFCompiler.h:54
int parseToAst(const char *file_name)
std::string udf_file_name_
Definition: UDFCompiler.h:53
int compileUdf()
void replaceExtn(std::string &s, const std::string &new_ext)
void readGpuCompiledModule()
int compileFromCommandLine(std::vector< const char * > &command_line)
std::string getFileExt(std::string &s)
int compileForGpu()