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

Method InitFromGraph

tensorflow/lite/delegates/gpu/cl/inference_context.cc:128–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128Status InferenceContext::InitFromGraph(const CreateInferenceInfo& create_info,
129 const GraphFloat32& graph,
130 Environment* env) {
131 precision_ = create_info.precision;
132 storage_type_ = create_info.storage_type;
133 if (env->device().vendor() == Vendor::MALI) {
134 need_flush_ = true;
135 need_manual_release_ = true;
136 }
137 CopyInAndOutIds(graph);
138 CreationContext creation_context;
139 creation_context.device = env->GetDevicePtr();
140 creation_context.context = &env->context();
141 creation_context.queue = env->queue();
142 creation_context.cache = env->program_cache();
143 RETURN_IF_ERROR(
144 ConvertOperations(creation_context, graph, create_info.hints));
145 Merge();
146 RETURN_IF_ERROR(
147 AllocateMemory(graph, env->device(), creation_context.context));
148 BindMemoryToOperations();
149 RETURN_IF_ERROR(Compile(creation_context));
150
151 TuningParameters tuning_parameters;
152 tuning_parameters.queue = env->profiling_queue();
153 tuning_parameters.info = env->device().GetInfoPtr();
154 if (create_info.hints.Check(ModelHints::kFastTuning)) {
155 tuning_parameters.tuning_type = TuningType::FAST;
156 }
157 RETURN_IF_ERROR(Tune(tuning_parameters));
158 return OkStatus();
159}
160
161Status InferenceContext::InitFromGraphWithTransforms(
162 const CreateInferenceInfo& create_info, GraphFloat32* graph,

Callers 1

InitializeMethod · 0.45

Calls 12

OkStatusFunction · 0.85
vendorMethod · 0.80
GetDevicePtrMethod · 0.80
program_cacheMethod · 0.80
profiling_queueMethod · 0.80
GetInfoPtrMethod · 0.80
MergeFunction · 0.50
CompileFunction · 0.50
deviceMethod · 0.45
contextMethod · 0.45
queueMethod · 0.45
CheckMethod · 0.45

Tested by

no test coverage detected