Skip to content

[GPU] Automatically dump lowered mlir module on 'enableObjectDump=true' #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/gc/ExecutionEngine/GPURuntime/ocl/GpuOclRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,10 @@ OclModuleBuilder::build(const OclRuntime::Ext &ext) {
opts.enablePerfNotificationListener = false;
#endif

if (enableObjectDump) {
mod.dump();
}

Comment on lines +811 to +814
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AndreyPavlenko what do you think, should it be a separate option in OclModuleBuilderOptions? Or maybe we can add a bool parameter to OclModuleBuilder::build(..., bool dump_lowered_module=false)?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be a separate option, because enableObjectDump is used to dump the compiled object.
It could also be implemented without adding a new option, like here -

builderOpts.pipeline = opts.printIr ? [](OpPassManager &pm) {

auto eng = ExecutionEngine::create(mod, opts);
CHECKE(eng, "Failed to create ExecutionEngine!");
eng->get()->registerSymbols(OclRuntime::Exports::symbolMap);
Expand Down