-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcodegen.hpp
More file actions
34 lines (31 loc) · 861 Bytes
/
codegen.hpp
File metadata and controls
34 lines (31 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __CODEGEN_HPP__
#define __CODEGEN_HPP__
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <sstream>
#include <cstdlib>
#include <tuple>
#include <algorithm>
#include "funcdefn.hpp"
class codegen {
private:
start_node *start;
std::stringstream header;
std::stringstream gpu_code;
std::stringstream host_code;
public:
codegen (start_node *);
void print_parameters (void);
void print_temp_decls (void);
void print_unroll_decls (void);
void print_var_decls (void);
void print_array_decls (void);
void print_func_calls (void);
void generate_code (std::stringstream &, std::stringstream &, std::stringstream &, std::map<std::string, int> &, std::vector<std::string> &, DATA_TYPE, int, int, bool, bool, bool, bool, std::string);
};
inline codegen::codegen (start_node *node) {
start = node;
}
#endif