Skip to content

Commit

Permalink
remove const_cast with some code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
ibaned committed Jan 24, 2023
1 parent 5212d90 commit 153b4c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion simd/src/Kokkos_SIMD_AVX512.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ class simd_mask<T, simd_abi::avx512_fixed_size<8>> {
}
KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION value_type
operator[](std::size_t i) const {
return reference(const_cast<simd_mask*>(this)->m_value, int(i));
auto const bit_mask = __mmask8(std::int16_t(1 << i));
return (m_value & bit_mask) != 0;
}
KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask
operator||(simd_mask const& other) const {
Expand Down

0 comments on commit 153b4c1

Please sign in to comment.