Skip to content

Commit

Permalink
[BugFix] fix nvptx not supported by device_enabled error (apache#9585)
Browse files Browse the repository at this point in the history
* [BugFix] fix nvptx not supported by device_enabled error

Signed-off-by: ZQPei <[email protected]>

* [BugFix] shared.dyn support for codegen_nvptx

Signed-off-by: ZQPei <[email protected]>
  • Loading branch information
ZQPei authored and mehrdadh committed Dec 1, 2021
1 parent 261cc4e commit 08bd4ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ bool RuntimeEnabled(const std::string& target) {
} else if (target == "hexagon") {
f_name = "device_api.hexagon";
} else if (target.length() >= 5 && target.substr(0, 5) == "nvptx") {
f_name = "device_api.gpu";
f_name = "device_api.cuda";
} else if (target.length() >= 4 && target.substr(0, 4) == "rocm") {
f_name = "device_api.rocm";
} else if (target.length() >= 4 && target.substr(0, 4) == "llvm") {
Expand Down
2 changes: 1 addition & 1 deletion src/target/llvm/codegen_nvptx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class CodeGenNVPTX : public CodeGenLLVM {
if (sync == "warp") {
// TODO(tqchen) warp sync in CUDA9
return nullptr;
} else if (sync == "shared") {
} else if (sync == "shared" || sync == "shared.dyn") {
llvm::Function* f =
llvm::Intrinsic::getDeclaration(module_.get(), ::llvm::Intrinsic::nvvm_barrier0);
return builder_->CreateCall(f, {});
Expand Down

0 comments on commit 08bd4ca

Please sign in to comment.