Skip to content

Fix Kokkos::ArithTraits<T>::nan() performance

James Willenbring requested to merge ibaned:kokkos-kernels-35 into develop

Created by: ibaned

This is a pair of commits to fix kokkos/kokkos-kernels#35. The performance of MiniTensor was severely degraded when moving from Teuchos::ScalarTraits to Kokkos::ArithTraits due to the slow implementation of nan(). This PR adds a performance test to measure MiniTensor initialization performance, and changes the implementation of Kokkos::ArithTraits<T>::nan() to use std::numeric_limits<T>::quiet_NaN(), which the performance test confirms is much faster.

@lxmota @crtrott @mhoemmen

Once the respective package owners have approved, I can run the checkin test and push this.

Merge request reports