OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UdfCompiler.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 #ifndef UDF_COMPILER_H
18 #define UDF_COMPILER_H
19 
20 #include <string>
21 #include <vector>
22 
23 #include "CudaMgr/CudaMgr.h"
24 
31 class UdfCompiler {
32  public:
34  const std::string& clang_path_override = "");
36  const std::string& clang_path_override,
37  const std::vector<std::string> clang_options);
38 
45  std::pair<std::string, std::string> compileUdf(const std::string& udf_file_name) const;
46 
47  static std::string getAstFileName(const std::string& udf_file_name);
48 
49  private:
53  void generateAST(const std::string& file_name) const;
54 
55  static std::string genLLVMIRFilename(const std::string& udf_file_name);
56  static std::string genNVVMIRFilename(const std::string& udf_file_name);
57 
62 #ifdef HAVE_CUDA
63  std::string compileToNVVMIR(const std::string& udf_file_name) const;
64 #endif
65  std::string compileToLLVMIR(const std::string& udf_file_name) const;
66 
70  int compileFromCommandLine(const std::vector<std::string>& command_line) const;
71 
72  std::string clang_path_;
73  std::vector<std::string> clang_options_;
74 #ifdef HAVE_CUDA
76 #endif
77 };
78 
79 #endif
std::vector< std::string > clang_options_
Definition: UdfCompiler.h:73
static std::string getAstFileName(const std::string &udf_file_name)
int compileFromCommandLine(const std::vector< std::string > &command_line) const
void generateAST(const std::string &file_name) const
UdfCompiler(CudaMgr_Namespace::NvidiaDeviceArch target_arch, const std::string &clang_path_override="")
static std::string genNVVMIRFilename(const std::string &udf_file_name)
std::string compileToLLVMIR(const std::string &udf_file_name) const
static std::string genLLVMIRFilename(const std::string &udf_file_name)
std::pair< std::string, std::string > compileUdf(const std::string &udf_file_name) const
std::string clang_path_
Definition: UdfCompiler.h:72