Commit 22a21995 by alex-weaver Committed by Tianqi Chen

[TVM] Fixed SPIR-V codegen for OpControlBarrier (#1409)

parent 81db22c5
...@@ -93,12 +93,14 @@ spirv::Value CodeGenSPIRV::CreateStorageSync(const Call* op) { ...@@ -93,12 +93,14 @@ spirv::Value CodeGenSPIRV::CreateStorageSync(const Call* op) {
if (sync == "warp") { if (sync == "warp") {
return value; return value;
} else if (sync == "shared") { } else if (sync == "shared") {
auto type_int = builder_->GetSType(Int(32));
builder_->MakeInst( builder_->MakeInst(
spv::OpControlBarrier, spv::OpControlBarrier,
spv::ScopeWorkgroup, builder_->IntImm(type_int, static_cast<int64_t>(spv::ScopeWorkgroup)),
spv::ScopeWorkgroup, builder_->IntImm(type_int, static_cast<int64_t>(spv::ScopeWorkgroup)),
builder_->IntImm(type_int, static_cast<int64_t>(
spv::MemorySemanticsSequentiallyConsistentMask | spv::MemorySemanticsSequentiallyConsistentMask |
spv::MemorySemanticsWorkgroupMemoryMask); spv::MemorySemanticsWorkgroupMemoryMask)));
} else { } else {
LOG(FATAL) << "Do not support sync " << sync; LOG(FATAL) << "Do not support sync " << sync;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment