MCPcopy Create free account
hub / github.com/alibaba/MNN / loadProgram

Method loadProgram

source/backend/opencl/core/runtime/OpenCLRuntime.cpp:466–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466bool OpenCLRuntime::loadProgram(const std::string &programName, cl::Program *program) {
467 std::lock_guard<std::mutex> lck(gCLMutex);
468 auto it_source = OpenCLProgramMap.find(programName);
469 if (it_source != OpenCLProgramMap.end()) {
470 cl::Program::Sources sources;
471 std::string source(it_source->second);
472 sources.push_back(source);
473 *program = cl::Program(context(), sources);
474 return true;
475 } else {
476 MNN_PRINT("Can't find kernel source !\n");
477 return false;
478 }
479}
480
481bool OpenCLRuntime::buildProgram(const std::string &buildOptionsStr, cl::Program *program) {
482 AUTOTIME;

Callers 1

buildKernelWithCacheMethod · 0.95

Calls 4

ProgramClass · 0.50
findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected