1#pragma once
2
3#include "taichi/util/lang_util.h"
4#include <set>
5
6namespace taichi::lang {
7
8class Kernel;
9
10class CCProgramImpl;
11
12namespace cccp {
13
14class CCKernel {
15 public:
16 CCKernel(CCProgramImpl *cc_program_impl,
17 Kernel *kernel,
18 std::string const &source,
19 std::string const &name)
20 : cc_program_impl_(cc_program_impl),
21 kernel_(kernel),
22 name_(name),
23 source_(source) {
24 }
25
26 void compile();
27 void launch(RuntimeContext *ctx);
28 std::string get_object() {
29 return obj_path_;
30 }
31
32 private:
33 CCProgramImpl *cc_program_impl_{nullptr};
34 Kernel *kernel_;
35
36 std::string name_;
37 std::string source_;
38
39 std::string src_path_;
40 std::string obj_path_;
41};
42
43} // namespace cccp
44} // namespace taichi::lang
45