From a0a2b7e50998a2f06e88f9032cae66bd5f80f457 Mon Sep 17 00:00:00 2001 From: alex-weaver Date: Tue, 10 Jul 2018 02:56:24 +0100 Subject: [PATCH] [TVM] Fixed SPIR-V codegen for OpControlBarrier (#1409) --- src/codegen/spirv/codegen_spirv.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/codegen/spirv/codegen_spirv.cc b/src/codegen/spirv/codegen_spirv.cc index 2c71d94eaba12..395bdff1477db 100644 --- a/src/codegen/spirv/codegen_spirv.cc +++ b/src/codegen/spirv/codegen_spirv.cc @@ -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(spv::ScopeWorkgroup)), + builder_->IntImm(type_int, static_cast(spv::ScopeWorkgroup)), + builder_->IntImm(type_int, static_cast( spv::MemorySemanticsSequentiallyConsistentMask | - spv::MemorySemanticsWorkgroupMemoryMask); + spv::MemorySemanticsWorkgroupMemoryMask))); } else { LOG(FATAL) << "Do not support sync " << sync; }