| 464 | } |
| 465 | |
| 466 | bool 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 | |
| 481 | bool OpenCLRuntime::buildProgram(const std::string &buildOptionsStr, cl::Program *program) { |
| 482 | AUTOTIME; |
no test coverage detected