1#pragma once
2
3#include "taichi/util/lang_util.h"
4#include "taichi/codegen/codegen.h"
5
6namespace taichi::lang {
7
8class CCProgramImpl;
9
10namespace cccp {
11
12class CCKernel;
13
14class 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
33FunctionType compile_kernel(Kernel *kernel);
34
35} // namespace cccp
36} // namespace taichi::lang
37