| 479 | } |
| 480 | |
| 481 | bool OpenCLRuntime::buildProgram(const std::string &buildOptionsStr, cl::Program *program) { |
| 482 | AUTOTIME; |
| 483 | cl_int ret = program->build({*mFirstGPUDevicePtr}, buildOptionsStr.c_str()); |
| 484 | if (ret != CL_SUCCESS) { |
| 485 | if (program->getBuildInfo<CL_PROGRAM_BUILD_STATUS>(*mFirstGPUDevicePtr) == CL_BUILD_ERROR) { |
| 486 | std::string buildLog = program->getBuildInfo<CL_PROGRAM_BUILD_LOG>(*mFirstGPUDevicePtr); |
| 487 | MNN_PRINT("Program build log: %s \n", buildLog.c_str()); |
| 488 | } |
| 489 | MNN_PRINT("Build program failed, err:%d ! \n", ret); |
| 490 | return false; |
| 491 | } |
| 492 | return true; |
| 493 | } |
| 494 | |
| 495 | |
| 496 | std::shared_ptr<KernelWrap> OpenCLRuntime::buildKernel(const std::string &programName, const std::string &kernelName, |
no test coverage detected