Skip to content

Commit

Permalink
[TVM] Fixed SPIR-V codegen for OpControlBarrier (apache#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-weaver authored and sergei-mironov committed Aug 8, 2018
1 parent da7eafb commit a0a2b7e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/codegen/spirv/codegen_spirv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ spirv::Value CodeGenSPIRV::CreateStorageSync(const Call* op) {
if (sync == "warp") {
return value;
} else if (sync == "shared") {
auto type_int = builder_->GetSType(Int(32));
builder_->MakeInst(
spv::OpControlBarrier,
spv::ScopeWorkgroup,
spv::ScopeWorkgroup,
spv::OpControlBarrier,
builder_->IntImm(type_int, static_cast<int64_t>(spv::ScopeWorkgroup)),
builder_->IntImm(type_int, static_cast<int64_t>(spv::ScopeWorkgroup)),
builder_->IntImm(type_int, static_cast<int64_t>(
spv::MemorySemanticsSequentiallyConsistentMask |
spv::MemorySemanticsWorkgroupMemoryMask);
spv::MemorySemanticsWorkgroupMemoryMask)));
} else {
LOG(FATAL) << "Do not support sync " << sync;
}
Expand Down

0 comments on commit a0a2b7e

Please sign in to comment.