Skip to content

Commit de55e41

Browse files
committed
Add config option to clear adjoints as parts of tape resets.
1 parent af7e508 commit de55e41

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

include/opdi/config.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ static_assert(OPDI_OMPT_BACKEND_BARRIER_IMPLEMENTATION_BEHAVIOUR <= 2);
8888
static_assert(0 < OPDI_DEFAULT_ADJOINT_ACCESS_MODE);
8989
static_assert(OPDI_DEFAULT_ADJOINT_ACCESS_MODE <= 2);
9090

91+
#ifndef OPDI_OMP_LOGIC_CLEAR_ADJOINTS
92+
#define OPDI_OMP_LOGIC_CLEAR_ADJOINTS 0
93+
#endif
94+
9195
/* sync region behaviour */
9296

9397
#ifndef OPDI_SYNC_REGION_BARRIER_BEHAVIOUR

include/opdi/logic/omp/parallelOmpLogic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void opdi::ParallelOmpLogic::deleteFunc(void* parallelDataPtr) {
123123
void* oldTape = tool->getThreadLocalTape();
124124
tool->setThreadLocalTape(implicitTaskData->newTape);
125125

126-
tool->reset(implicitTaskData->newTape, implicitTaskData->positions[0], false);
126+
tool->reset(implicitTaskData->newTape, implicitTaskData->positions[0], OPDI_OMP_LOGIC_CLEAR_ADJOINTS);
127127

128128
tool->setThreadLocalTape(oldTape);
129129

0 commit comments

Comments
 (0)