Skip to content
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

[NVPTX] libdevice support, enable NVPTX backend in topi tests #1365

Merged
merged 12 commits into from
Jul 3, 2018

Conversation

masahi
Copy link
Member

@masahi masahi commented Jul 1, 2018

Math function support has been missing for NVPTX backend. This PR attempts to fix the final missing piece.

All topi tests pass with nvptx backend.

@masahi masahi changed the title [WIP, NVPTX] libdevice support, enable NVPTX backend in topi tests [NVPTX] libdevice support, enable NVPTX backend in topi tests Jul 2, 2018
@masahi
Copy link
Member Author

masahi commented Jul 2, 2018

@tqchen ready for a review. can you have a look?

const Call* call = e.as<Call>();
CHECK(call != nullptr);
std::ostringstream intrinsic_name;
intrinsic_name << "__nv_" << call->name << "f";
Copy link
Member

Choose a reason for hiding this comment

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

Does this works for double type? The f suffix seems to be hardcoded for float32

Copy link
Member

Choose a reason for hiding this comment

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

Need to dispatch by type to support double type

if (fname.substr(0, 4) != "__nv") continue;
// This is to strip off unused __nv_* functions from the final module
// The one that is actually used will be inlined at call site
// See Halide's LLVM_Runtime_Linker.cpp
Copy link
Member

Choose a reason for hiding this comment

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

See Halide's LLVM_Runtime_Linker.cpp -> adopted from Halide's runtime linker. if you have referred to the code

if (fname.substr(0, 4) != "__nv") continue;
// This is to strip off unused __nv_* functions from the final module
// The one that is actually used will be inlined at call site
// Adopted from Halide's runtime linker
Copy link
Member

Choose a reason for hiding this comment

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

sorry, adopted-> adapted, my mistake on the previous comment

Copy link
Member

@tqchen tqchen left a comment

Choose a reason for hiding this comment

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

@masahi
Copy link
Member Author

masahi commented Jul 3, 2018

@tqchen fixed lint and passed CI. Thanks for the review.

@tqchen tqchen merged commit e4c099e into apache:master Jul 3, 2018
@tqchen tqchen added status: accepted and removed status: need update need update based on feedbacks status: review in progress labels Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants