| 306 | // Helper function to get test result from filters |
| 307 | template <typename TScalarType, typename ImageToImageFilterType, typename OutputImage> |
| 308 | void |
| 309 | GetTestFilterResult(typename ImageToImageFilterType::Pointer & cpuFilter, |
| 310 | typename ImageToImageFilterType::Pointer & gpuFilter, |
| 311 | const float allowedRMSerror, |
| 312 | TScalarType & rmsError, |
| 313 | TScalarType & rmsRelative, |
| 314 | bool & testPassed, |
| 315 | const bool skipCPU, |
| 316 | const bool skipGPU, |
| 317 | const TimeProbe::TimeStampType cpuTime, |
| 318 | const TimeProbe::TimeStampType gpuTime, |
| 319 | const bool updateExceptionCPU, |
| 320 | const bool updateExceptionGPU, |
| 321 | const unsigned int outputindex = 0) |
| 322 | { |
| 323 | rmsError = 0.0; |
| 324 | testPassed = true; |
| 325 | if (updateExceptionCPU || updateExceptionGPU) |
| 326 | { |
| 327 | testPassed = false; |
| 328 | } |
| 329 | else |
| 330 | { |
| 331 | if (!skipCPU && !skipGPU && cpuFilter.IsNotNull() && gpuFilter.IsNotNull()) |
| 332 | { |
| 333 | if (outputindex == 0) |
| 334 | { |
| 335 | rmsError = ComputeRMSE<TScalarType, OutputImage, OutputImage>( |
| 336 | cpuFilter->GetOutput(), gpuFilter->GetOutput(), rmsRelative); |
| 337 | } |
| 338 | else |
| 339 | { |
| 340 | rmsError = ComputeRMSE<TScalarType, OutputImage, OutputImage>( |
| 341 | cpuFilter->GetOutput(outputindex), gpuFilter->GetOutput(outputindex), rmsRelative); |
| 342 | } |
| 343 | |
| 344 | std::cout << ", speed up " << (cpuTime / gpuTime) << std::endl; |
| 345 | std::cout << std::fixed << std::setprecision(8); |
| 346 | std::cout << "Maximum allowed RMS Error: " << allowedRMSerror << std::endl; |
| 347 | std::cout << "Computed real RMS Error: " << rmsError << std::endl; |
| 348 | std::cout << "Computed real nRMS Error: " << rmsRelative << std::endl; |
| 349 | |
| 350 | testPassed = (rmsError <= allowedRMSerror); |
| 351 | } |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | |
| 356 | //------------------------------------------------------------------------------ |
nothing calls this directly
no outgoing calls
no test coverage detected