From a62c5bbc100a5e5a31ea0ccc4a78d8fa6a4167ce Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 15 May 2020 02:54:06 -0300 Subject: [PATCH] barrier: Add OpControlBarrier --- include/sirit/sirit.h | 3 +++ src/instructions/barrier.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index d9e9a8c..1fb8013 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -366,6 +366,9 @@ public: // Barrier + /// Wait for other invocations of this module to reach the current point of execution. + Id OpControlBarrier(Id execution, Id memory, Id semantics); + /// Control the order that memory accesses are observed. Id OpMemoryBarrier(Id scope, Id semantics); diff --git a/src/instructions/barrier.cpp b/src/instructions/barrier.cpp index 8f91c8a..da74bf5 100644 --- a/src/instructions/barrier.cpp +++ b/src/instructions/barrier.cpp @@ -10,6 +10,14 @@ namespace Sirit { +Id Module::OpControlBarrier(Id execution, Id memory, Id semantics) { + auto op = std::make_unique(spv::Op::OpControlBarrier); + op->Add(execution); + op->Add(memory); + op->Add(semantics); + return AddCode(std::move(op)); +} + Id Module::OpMemoryBarrier(Id scope, Id semantics) { auto op = std::make_unique(spv::Op::OpMemoryBarrier); op->Add(scope);