Files
deeplearning4j--deeplearning4j/libnd4j/include/legacy/cpu/NativeOps_OpContextLifecycle.cpp
T
2026-07-13 12:47:05 +08:00

25 lines
850 B
C++

#include <legacy/NativeOps.h>
#include <graph/OpContextLifecycleTracker.h>
#include <graph/Context.h>
void recordJavaOpContextAllocation(OpaqueContext *context, int nodeId, long fastpathInSize, long fastpathOutSize, long intermediateResultsSize, long handlesSize, bool hasWorkspace, bool isFastPath) {
#if defined(SD_GCC_FUNCTRACE)
if (context != nullptr) {
sd::graph::OpContextLifecycleTracker::getInstance().recordAllocation(
context, nodeId, fastpathInSize, fastpathOutSize, intermediateResultsSize, handlesSize, hasWorkspace, isFastPath, sd::graph::OpContextSegment::JAVA);
}
#endif
}
void recordJavaOpContextDeallocation(OpaqueContext *context) {
#if defined(SD_GCC_FUNCTRACE)
if (context != nullptr) {
sd::graph::OpContextLifecycleTracker::getInstance().recordDeallocation(context);
}
#endif
}