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

Function LoadOpenCL

tensorflow/lite/delegates/gpu/cl/opencl_wrapper.cc:34–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 }
33
34Status LoadOpenCL() {
35 void* libopencl = dlopen("libOpenCL.so", RTLD_NOW | RTLD_LOCAL);
36 if (libopencl) {
37 LoadOpenCLFunctions(libopencl, false);
38 return OkStatus();
39 } else {
40 // Pixel phone?
41 libopencl = dlopen("libOpenCL-pixel.so", RTLD_NOW | RTLD_LOCAL);
42 if (libopencl) {
43 typedef void (*enableOpenCL_t)();
44 enableOpenCL_t enableOpenCL =
45 reinterpret_cast<enableOpenCL_t>(dlsym(libopencl, "enableOpenCL"));
46 enableOpenCL();
47 LoadOpenCLFunctions(libopencl, true);
48 return OkStatus();
49 } else {
50 return UnknownError(
51 absl::StrCat("OpenCL library not loaded - ", dlerror()));
52 }
53 }
54}
55
56void LoadOpenCLFunctions(void* libopencl, bool is_pixel) {
57 typedef void* (*loadOpenCLPointer_t)(const char* name);

Callers 3

OpenCLSupportedFunction · 0.85
InitMethod · 0.85
SetUpMethod · 0.85

Calls 4

LoadOpenCLFunctionsFunction · 0.85
OkStatusFunction · 0.85
UnknownErrorFunction · 0.50
StrCatFunction · 0.50

Tested by 1

SetUpMethod · 0.68