1 | #pragma once |
---|---|
2 | |
3 | #include "taichi/util/lang_util.h" |
4 | #include "taichi/codegen/codegen.h" |
5 | |
6 | namespace taichi::lang { |
7 | |
8 | class CCProgramImpl; |
9 | |
10 | namespace cccp { |
11 | |
12 | class CCKernel; |
13 | |
14 | class CCKernelGen { |
15 | // Generate corresponding C Source Code for a Taichi Kernel |
16 | public: |
17 | CCKernelGen(const CompileConfig &compile_config, |
18 | Kernel *kernel, |
19 | CCProgramImpl *cc_program_impl) |
20 | : compile_config_(compile_config), |
21 | cc_program_impl_(cc_program_impl), |
22 | kernel_(kernel) { |
23 | } |
24 | |
25 | std::unique_ptr<CCKernel> compile(); |
26 | |
27 | private: |
28 | const CompileConfig &compile_config_; |
29 | CCProgramImpl *cc_program_impl_{nullptr}; |
30 | Kernel *kernel_; |
31 | }; |
32 | |
33 | FunctionType compile_kernel(Kernel *kernel); |
34 | |
35 | } // namespace cccp |
36 | } // namespace taichi::lang |
37 |