Skip to content

Commit 9d688d9

Browse files
committed
Add test for tape activity to addReverseFlush.
1 parent 418fcb2 commit 9d688d9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

include/opdi/logic/omp/flushOmpLogic.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ namespace opdi {
5151
public:
5252

5353
virtual void addReverseFlush() {
54-
Handle* handle = new Handle;
55-
handle->reverseFunc = FlushOmpLogic::reverseFunc;
56-
tool->pushExternalFunction(tool->getThreadLocalTape(), handle);
54+
55+
if (tool != nullptr && tool->getThreadLocalTape() != nullptr && tool->isActive(tool->getThreadLocalTape())) {
56+
57+
Handle* handle = new Handle;
58+
handle->reverseFunc = FlushOmpLogic::reverseFunc;
59+
tool->pushExternalFunction(tool->getThreadLocalTape(), handle);
60+
}
5761
}
5862
};
5963
}

0 commit comments

Comments
 (0)