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

Method Compile

tensorflow/lite/delegates/gpu/cl/kernels/pooling.cc:195–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195Status Pooling::Compile(const CreationContext& creation_context) {
196 std::string code;
197 const bool manual_boundary_check =
198 definition_.src_tensors[0].storage_type == TensorStorageType::BUFFER ||
199 creation_context.device->IsAdreno3xx();
200 switch (type_) {
201 case PoolingType::AVERAGE:
202 code = GetAveragePoolingKernelCode(
203 definition_.src_tensors[0], definition_.dst_tensors[0],
204 definition_.precision, linked_operations_, manual_boundary_check);
205 break;
206 case PoolingType::MAX:
207 code = GetMaxPoolingKernelCode(
208 definition_.src_tensors[0], definition_.dst_tensors[0],
209 definition_.precision, linked_operations_, output_indices_);
210 break;
211 default:
212 return InvalidArgumentError(
213 "You should create another kernel with this params");
214 break;
215 }
216 return creation_context.cache->GetOrCreateCLKernel(
217 code, "main_function", *creation_context.context,
218 *creation_context.device, &kernel_);
219}
220
221Status Pooling::BindArguments() {
222 kernel_.ResetBindingCounter();

Callers

nothing calls this directly

Calls 5

GetMaxPoolingKernelCodeFunction · 0.85
IsAdreno3xxMethod · 0.80
GetOrCreateCLKernelMethod · 0.80
InvalidArgumentErrorFunction · 0.50

Tested by

no test coverage detected