From 9a1114c5ffb0cb6f6ebafcd2a6fbe14116afe1f8 Mon Sep 17 00:00:00 2001 From: Deukhyun Cha Date: Mon, 18 Mar 2024 18:06:54 -0500 Subject: [PATCH] add C API --- include/occa/c/base.h | 2 ++ src/c/base.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/occa/c/base.h b/include/occa/c/base.h index 602004f52..57c2a56e6 100644 --- a/include/occa/c/base.h +++ b/include/occa/c/base.h @@ -35,6 +35,8 @@ occaStreamTag occaTagStream(); void occaWaitForTag(occaStreamTag tag); +void occaStreamWaitForTag(occaStream stream, occaStreamTag tag); + double occaTimeBetweenTags(occaStreamTag startTag, occaStreamTag endTag); diff --git a/src/c/base.cpp b/src/c/base.cpp index 4fc5c6753..066101b90 100644 --- a/src/c/base.cpp +++ b/src/c/base.cpp @@ -75,6 +75,10 @@ void occaWaitForTag(occaStreamTag tag) { occa::waitFor(occa::c::streamTag(tag)); } +void occaStreamWaitForTag(occaStream stream, occaStreamTag tag) { + occa::streamWait(occa::c::stream(stream), occa::c::streamTag(tag)); +} + double occaTimeBetweenTags(occaStreamTag startTag, occaStreamTag endTag) { return occa::timeBetween(occa::c::streamTag(startTag),