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

Method Init

tensorflow/lite/delegates/gpu/cl/api.cc:707–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705 : options_(options) {}
706
707 Status Init() {
708 RETURN_IF_ERROR(LoadOpenCL());
709 properties_.is_opencl_available = true;
710
711 if (options_.IsGlAware()) {
712 RETURN_IF_ERROR(CreateGLCompatibleEnvironment(
713 reinterpret_cast<cl_context_properties>(options_.egl_context),
714 reinterpret_cast<cl_context_properties>(options_.egl_display),
715 &environment_));
716 } else {
717 RETURN_IF_ERROR(CreateEnvironment(&environment_));
718 }
719 auto& device = environment_.device();
720 properties_.is_gl_sharing_supported = IsGlSharingSupported(device);
721 properties_.is_gl_to_cl_fast_sync_supported =
722 IsClEventFromEglSyncSupported(device);
723 properties_.is_cl_to_gl_fast_sync_supported =
724 IsEglSyncFromClEventSupported();
725 if (options_.IsGlAware() && !properties_.is_gl_sharing_supported) {
726 return UnavailableError("GL sharing is not supported");
727 }
728 return OkStatus();
729 }
730
731 Status NewInferenceBuilder(const InferenceOptions& options,
732 const GraphFloat32& model,

Callers

nothing calls this directly

Calls 10

LoadOpenCLFunction · 0.85
CreateEnvironmentFunction · 0.85
IsGlSharingSupportedFunction · 0.85
OkStatusFunction · 0.85
IsGlAwareMethod · 0.80
UnavailableErrorFunction · 0.50
deviceMethod · 0.45

Tested by

no test coverage detected