MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IncrementUsageCounter

Function IncrementUsageCounter

tensorflow/lite/kernels/eigen_support.cc:145–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143} // namespace
144
145void IncrementUsageCounter(TfLiteContext* context) {
146 auto* ptr = GetEigenContext(context);
147 if (ptr == nullptr) {
148 if (context->recommended_num_threads != -1) {
149 SetEigenNbThreads(context->recommended_num_threads);
150 }
151 ptr = new RefCountedEigenContext;
152 ptr->type = kTfLiteEigenContext;
153 ptr->Refresh = Refresh;
154 ptr->thread_pool_holder.reset(
155 new LazyEigenThreadPoolHolder(context->recommended_num_threads));
156 ptr->num_references = 0;
157 context->SetExternalContext(context, kTfLiteEigenContext, ptr);
158 }
159 ptr->num_references++;
160}
161
162void DecrementUsageCounter(TfLiteContext* context) {
163 auto* ptr = GetEigenContext(context);

Callers 3

InitFunction · 0.85
TESTFunction · 0.85
InitFunction · 0.85

Calls 4

GetEigenContextFunction · 0.85
SetEigenNbThreadsFunction · 0.85
resetMethod · 0.45
SetExternalContextMethod · 0.45

Tested by 1

TESTFunction · 0.68