| 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, |
nothing calls this directly
no test coverage detected