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

Method buildProgram

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

Source from the content-addressed store, hash-verified

479}
480
481bool 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
496std::shared_ptr<KernelWrap> OpenCLRuntime::buildKernel(const std::string &programName, const std::string &kernelName,

Callers 2

buildKernelWithCacheMethod · 0.95
buildKernelFromSourceMethod · 0.95

Calls 2

buildMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected