Skip to content

Commit

Permalink
Fix some batched stuff missing KOKKOS_INLINE_FUNCTION
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed May 2, 2018
1 parent 1c68159 commit 8bf7a62
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/batched/KokkosBatched_Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,29 @@ namespace KokkosBatched {
template<int l> struct ValueScalarType<Vector<SIMD<Kokkos::complex<float> >,l> > { typedef Kokkos::complex<float> type; };
template<int l> struct ValueScalarType<Vector<SIMD<Kokkos::complex<double> >,l> > { typedef Kokkos::complex<double> type; };

template<typename T> typename Kokkos::Details::ArithTraits<T>::mag_type RealPart(const T &val) { return val; }
template<typename T> typename Kokkos::Details::ArithTraits<Kokkos::complex<T> >::mag_type RealPart(const Kokkos::complex<T> &val) { return val.real(); }
template<typename T, int l> typename Kokkos::Details::ArithTraits<Vector<SIMD<Kokkos::complex<T> >,l> >::mag_type
template<typename T>
KOKKOS_INLINE_FUNCTION
typename Kokkos::Details::ArithTraits<T>::mag_type RealPart(const T &val) { return val; }
template<typename T>
KOKKOS_INLINE_FUNCTION
typename Kokkos::Details::ArithTraits<Kokkos::complex<T> >::mag_type RealPart(const Kokkos::complex<T> &val) { return val.real(); }
template<typename T, int l>
KOKKOS_INLINE_FUNCTION
typename Kokkos::Details::ArithTraits<Vector<SIMD<Kokkos::complex<T> >,l> >::mag_type
RealPart(const Vector<SIMD<Kokkos::complex<T> >,l> &val) {
typename Kokkos::Details::ArithTraits<Vector<SIMD<Kokkos::complex<T> >,l> >::mag_type r_val;
for (int i=0;i<l;++i) { r_val[i] = val[i].real(); }
return r_val;
}
template<typename T> typename Kokkos::Details::ArithTraits<T>::mag_type ImagPart(const T &val) { return 0; }
template<typename T> typename Kokkos::Details::ArithTraits<Kokkos::complex<T> >::mag_type ImagPart(const Kokkos::complex<T> &val) { return val.imag(); }
template<typename T, int l> typename Kokkos::Details::ArithTraits<Vector<SIMD<Kokkos::complex<T> >,l> >::mag_type
template<typename T>
KOKKOS_INLINE_FUNCTION
typename Kokkos::Details::ArithTraits<T>::mag_type ImagPart(const T &val) { return 0; }
template<typename T>
KOKKOS_INLINE_FUNCTION
typename Kokkos::Details::ArithTraits<Kokkos::complex<T> >::mag_type ImagPart(const Kokkos::complex<T> &val) { return val.imag(); }
template<typename T, int l>
KOKKOS_INLINE_FUNCTION
typename Kokkos::Details::ArithTraits<Vector<SIMD<Kokkos::complex<T> >,l> >::mag_type
ImagPart(const Vector<SIMD<Kokkos::complex<T> >,l> &val) {
typename Kokkos::Details::ArithTraits<Vector<SIMD<Kokkos::complex<T> >,l> >::mag_type r_val;
for (int i=0;i<l;++i) { r_val[i] = val[i].imag(); }
Expand Down

0 comments on commit 8bf7a62

Please sign in to comment.