MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateCLProgram

Function CreateCLProgram

tensorflow/lite/delegates/gpu/cl/cl_program.cc:140–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140Status CreateCLProgram(const std::string& code,
141 const std::string& compiler_options,
142 const CLContext& context, const CLDevice& device,
143 CLProgram* result) {
144 int error_code;
145 const char* source = code.c_str();
146
147 cl_program program = clCreateProgramWithSource(context.context(), 1, &source,
148 nullptr, &error_code);
149 if (!program || error_code != CL_SUCCESS) {
150 return UnknownError(absl::StrCat("Failed to create compute program - ",
151 CLErrorCodeToString(error_code)));
152 }
153
154 *result = CLProgram(program, device.id());
155 RETURN_IF_ERROR(BuildProgram(program, device, compiler_options));
156 return OkStatus();
157}
158
159Status CreateCLProgramFromBinary(const CLContext& context,
160 const CLDevice& device,

Callers 1

GetOrCreateCLKernelMethod · 0.85

Calls 9

CLErrorCodeToStringFunction · 0.85
CLProgramClass · 0.85
BuildProgramFunction · 0.85
OkStatusFunction · 0.85
c_strMethod · 0.80
UnknownErrorFunction · 0.50
StrCatFunction · 0.50
contextMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected