MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / load_default

Method load_default

src/core/CL/OpenCL.cpp:49–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49bool CLSymbols::load_default()
50{
51 static const std::vector<std::string> libraries_filenames{"libOpenCL.so", "libGLES_mali.so", "libmali.so"};
52
53 if (_loaded.first)
54 {
55 return _loaded.second;
56 }
57
58 // Indicate that default loading has been tried
59 _loaded.first = true;
60
61 if (load(libraries_filenames, /* use_loader */ false))
62 {
63 ARM_COMPUTE_ERROR_ON_MSG(this->clBuildProgram_ptr == nullptr,
64 "Failed to load OpenCL symbols from shared library");
65 return true;
66 }
67
68#ifdef __ANDROID__
69 // When running in NDK environment, the above libraries are not accessible.
70 static const std::vector<std::string> android_libraries_filenames{"libOpenCL-pixel.so", "libOpenCL-car.so"};
71
72 if (load(android_libraries_filenames, /* use_loader */ true))
73 {
74 ARM_COMPUTE_ERROR_ON_MSG(this->clBuildProgram_ptr == nullptr,
75 "Failed to load OpenCL symbols from android shared library");
76 return true;
77 }
78#endif // __ANDROID__
79
80 // If not returned till here then libraries not found
81 std::stringstream ss;
82 std::for_each(libraries_filenames.begin(), libraries_filenames.end(),
83 [&ss](const std::string &s) { ss << s << " "; });
84#ifdef __ANDROID__
85 std::for_each(android_libraries_filenames.begin(), android_libraries_filenames.end(),
86 [&ss](const std::string &s) { ss << s << " "; });
87#endif // __ANDROID__
88 std::cerr << "Couldn't find any of the following OpenCL library: " << ss.str() << std::endl;
89 return false;
90}
91
92bool CLSymbols::load(const std::vector<std::string> &libraries_filenames, bool use_loader)
93{

Callers 15

opencl_is_availableFunction · 0.80
clEnqueueMarkerFunction · 0.80
clWaitForEventsFunction · 0.80
clEnqueueSVMMapFunction · 0.80
clEnqueueSVMUnmapFunction · 0.80
clSVMAllocFunction · 0.80
clSVMFreeFunction · 0.80
clGetContextInfoFunction · 0.80
clCreateCommandQueueFunction · 0.80
clCreateContextFunction · 0.80
clCreateContextFromTypeFunction · 0.80

Calls 5

loadFunction · 0.85
for_eachFunction · 0.85
strMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected