Skip to content

Commit 6ee29d3

Browse files
Turn on JIT for LSTM (#1133)
1 parent 816fce4 commit 6ee29d3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

NeoMathEngine/src/CPU/CpuMathEngineDnnLstm.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,13 @@ void CCpuMathEngine::Lstm( CLstmDesc& desc, bool reverse, int sequenceLength, in
205205
sequenceCount, resultWidth, resultWidth, resultWidth, lstmDesc.FreeTerm );
206206
}
207207

208-
lstmDesc.RunOnceRestOfLstm(lstmDesc.IsCompatibleMode, sequenceCount, fullyConnectedResult[outputPos], stateBackLink[inputPos],
209-
stateBackLink[outputPos], mainBackLink[outputPos], output[outputPos]);
208+
if( simdMathEngine != nullptr && !lstmDesc.IsCompatibleMode ) {
209+
simdMathEngine->RunOnceRestOfLstm( &lstmDesc, sequenceCount, fullyConnectedResult[outputPos],
210+
stateBackLink[inputPos], stateBackLink[outputPos], mainBackLink[outputPos] );
211+
} else {
212+
lstmDesc.RunOnceRestOfLstm(lstmDesc.IsCompatibleMode, sequenceCount, fullyConnectedResult[outputPos], stateBackLink[inputPos],
213+
stateBackLink[outputPos], mainBackLink[outputPos], output[outputPos]);
214+
}
210215
--seqElemsInBuffer;
211216
}
212217
}

0 commit comments

Comments
 (0)