Skip to content

Commit fb4b7e2

Browse files
authored
[BugFix] fix nvptx not supported by device_enabled error (#9585)
* [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]>
1 parent eaa6aee commit fb4b7e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/runtime/module.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ bool RuntimeEnabled(const std::string& target) {
148148
} else if (target == "hexagon") {
149149
f_name = "device_api.hexagon";
150150
} else if (target.length() >= 5 && target.substr(0, 5) == "nvptx") {
151-
f_name = "device_api.gpu";
151+
f_name = "device_api.cuda";
152152
} else if (target.length() >= 4 && target.substr(0, 4) == "rocm") {
153153
f_name = "device_api.rocm";
154154
} else if (target.length() >= 4 && target.substr(0, 4) == "llvm") {

src/target/llvm/codegen_nvptx.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class CodeGenNVPTX : public CodeGenLLVM {
138138
if (sync == "warp") {
139139
// TODO(tqchen) warp sync in CUDA9
140140
return nullptr;
141-
} else if (sync == "shared") {
141+
} else if (sync == "shared" || sync == "shared.dyn") {
142142
llvm::Function* f =
143143
llvm::Intrinsic::getDeclaration(module_.get(), ::llvm::Intrinsic::nvvm_barrier0);
144144
return builder_->CreateCall(f, {});

0 commit comments

Comments
 (0)