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

Function Compile

tensorflow/lite/delegates/gpu/gl/api.cc:391–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389} // namespace
390
391Status Compile(const CompilationOptions& options, const GraphFloat32& model,
392 const std::unordered_set<int>& tflite_graph_io,
393 const NodeShader& node_shader,
394 const WorkgroupsCalculator& workgroup_calculator,
395 std::unique_ptr<CompiledModel>* compiled_model) {
396 if (!IsBatchMatchesForAllValues(model)) {
397 return InvalidArgumentError("Only identical batch dimension is supported");
398 }
399 GpuInfo gpu_info;
400 RETURN_IF_ERROR(RequestGpuInfo(&gpu_info));
401 if (!IsOpenGl31OrAbove(gpu_info)) {
402 return InternalError(
403 "OpenGL ES 3.1 or above is required to use OpenGL inference.");
404 }
405 auto compiled_model_impl = absl::make_unique<CompiledModelImpl>(gpu_info);
406 compiled_model_impl->set_dynamic_batch(options.dynamic_batch);
407 auto compiler = NewCompiler(&node_shader, &gpu_info, options);
408 RETURN_IF_ERROR(
409 compiler->Compile(model, tflite_graph_io, [&](ShaderCode code) -> Status {
410 return compiled_model_impl->Add(workgroup_calculator, std::move(code));
411 }));
412 *compiled_model = std::move(compiled_model_impl);
413 return OkStatus();
414}
415
416#ifndef TFLITE_GPU_BINARY_RELEASE
417Status ReadSerializedModel(const std::vector<uint8_t>& serialized_model,

Callers 12

PrepareMethod · 0.50
InvokeMethod · 0.50
InitFromGraphMethod · 0.50
MakeContextMethod · 0.50
ComputeMethod · 0.50
ComputeMethod · 0.50
TESTFunction · 0.50
CompileMethod · 0.50
ComputeMethod · 0.50
ComputeMethod · 0.50
CompileForDevicesMethod · 0.50
CompileForDevicesMethod · 0.50

Calls 9

RequestGpuInfoFunction · 0.85
IsOpenGl31OrAboveFunction · 0.85
NewCompilerFunction · 0.85
OkStatusFunction · 0.85
InvalidArgumentErrorFunction · 0.50
InternalErrorFunction · 0.50
CompileMethod · 0.45
AddMethod · 0.45

Tested by 3

InvokeMethod · 0.40
MakeContextMethod · 0.40
TESTFunction · 0.40