| 193 | } |
| 194 | |
| 195 | Status 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 | |
| 221 | Status Pooling::BindArguments() { |
| 222 | kernel_.ResetBindingCounter(); |
nothing calls this directly
no test coverage detected