| 264 | // Helper function to get test result from output images |
| 265 | template <typename TScalarType, typename CPUImageType, typename GPUImageType> |
| 266 | void |
| 267 | GetTestOutputResult(const CPUImageType * cpuImage, |
| 268 | const GPUImageType * gpuImage, |
| 269 | const float allowedRMSerror, |
| 270 | TScalarType & rmsError, |
| 271 | TScalarType & rmsRelative, |
| 272 | bool & testPassed, |
| 273 | const bool skipCPU, |
| 274 | const bool skipGPU, |
| 275 | const TimeProbe::TimeStampType cpuTime, |
| 276 | const TimeProbe::TimeStampType gpuTime, |
| 277 | const bool updateExceptionCPU, |
| 278 | const bool updateExceptionGPU) |
| 279 | { |
| 280 | rmsError = 0.0; |
| 281 | rmsRelative = 0.0; |
| 282 | testPassed = true; |
| 283 | if (updateExceptionCPU || updateExceptionGPU) |
| 284 | { |
| 285 | testPassed = false; |
| 286 | } |
| 287 | else |
| 288 | { |
| 289 | if (!skipCPU && !skipGPU && cpuImage && gpuImage) |
| 290 | { |
| 291 | rmsError = ComputeRMSE<TScalarType, CPUImageType, GPUImageType>(cpuImage, gpuImage, rmsRelative); |
| 292 | |
| 293 | std::cout << ", speed up " << (cpuTime / gpuTime) << std::endl; |
| 294 | std::cout << std::fixed << std::setprecision(8); |
| 295 | std::cout << "Maximum allowed RMS Error: " << allowedRMSerror << std::endl; |
| 296 | std::cout << "Computed real RMS Error: " << rmsError << std::endl; |
| 297 | std::cout << "Computed real nRMS Error: " << rmsRelative << std::endl; |
| 298 | |
| 299 | testPassed = (rmsError <= allowedRMSerror); |
| 300 | } |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | |
| 305 | //------------------------------------------------------------------------------ |
nothing calls this directly
no outgoing calls
no test coverage detected