Skip to content

feat: add a driver to manage the compile and link jobs#464

Open
mouliangyu wants to merge 1 commit into
feature-vpto-backendfrom
feature-new-driver2
Open

feat: add a driver to manage the compile and link jobs#464
mouliangyu wants to merge 1 commit into
feature-vpto-backendfrom
feature-new-driver2

Conversation

@mouliangyu

@mouliangyu mouliangyu commented May 31, 2026

Copy link
Copy Markdown
Owner
  1. the ptoas.cpp does not provide main anymore. only provides the compile/optimize stage
  2. the main is provided by driver.cpp, it works like:
// +----------------------------------------------------------+
// |                        .pto                              |
// +----------------------------------------------------------+
// +-------------+ +------------+ +------------+ +------------+
// | EmitC job   | | VPTO job   | | EmitC      | | VPTO       |
// |             | |            | | child job  | | child job  |
// |             | |            | +------------+ +------------+
// |             | |            | +---------------------------+
// |             | |            | | Fatobj link job           |
// +-------------+ +------------+ +---------------------------+
// +-------------+ +------------------------------------------+
// | C++ source  | |                fatobj                    |
// +-------------+ +------------------------------------------+

@mouliangyu mouliangyu force-pushed the feature-new-driver2 branch from 166e029 to c4ffbf2 Compare May 31, 2026 19:04
@mouliangyu mouliangyu force-pushed the feature-new-driver2 branch from c4ffbf2 to 5cd46e0 Compare May 31, 2026 19:42
llvm::raw_string_ostream os(stubSource);
os << "#ifndef AICORE\n#define AICORE [aicore]\n#endif\n\n";
for (const VPTOKernelStubDecl &decl : stubDecls) {
os << "extern \"C\" __global__ AICORE void " << decl.logicalName << "(";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里emit的是logicalName, CCE会把对 device kernel 的调用解析成 _mix_aic/_mix_aiv 引用,导致链接时找不到符号

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依赖 beta.2 cann 包

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants