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

Function CreateEnvironment

tensorflow/lite/delegates/gpu/cl/environment.cc:84–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84Status CreateEnvironment(Environment* result, bool shared,
85 cl_context_properties egl_context,
86 cl_context_properties egl_display) {
87 CLDevice gpu;
88 RETURN_IF_ERROR(CreateDefaultGPUDevice(&gpu));
89
90 CLContext context;
91 if (shared) {
92 RETURN_IF_ERROR(CreateCLGLContext(gpu, egl_context, egl_display, &context));
93 } else {
94 RETURN_IF_ERROR(CreateCLContext(gpu, &context));
95 }
96 CLCommandQueue queue;
97 RETURN_IF_ERROR(CreateCLCommandQueue(gpu, context, &queue));
98 ProfilingCommandQueue profiling_queue;
99 RETURN_IF_ERROR(CreateProfilingCommandQueue(gpu, context, &profiling_queue));
100
101 *result = Environment(std::move(gpu), std::move(context), std::move(queue),
102 std::move(profiling_queue));
103
104 if (result->device().IsAdreno() && result->device().SupportsTextureArray()) {
105 bool supports_one_layer;
106 RETURN_IF_ERROR(
107 CheckKernelSupportOfOneLayerTextureArray(result, &supports_one_layer));
108 if (!supports_one_layer) {
109 result->GetDevicePtr()->DisableOneLayerTextureArray();
110 }
111 }
112
113 return OkStatus();
114}
115} // namespace
116
117Environment::Environment(CLDevice&& device, CLContext&& context,

Callers 3

CreateDefaultEnvironmentFunction · 0.85
InitMethod · 0.85

Calls 13

CreateDefaultGPUDeviceFunction · 0.85
CreateCLGLContextFunction · 0.85
CreateCLContextFunction · 0.85
CreateCLCommandQueueFunction · 0.85
OkStatusFunction · 0.85
IsAdrenoMethod · 0.80
SupportsTextureArrayMethod · 0.80
GetDevicePtrMethod · 0.80
EnvironmentClass · 0.70

Tested by

no test coverage detected