Skip to content

Commit

Permalink
Work around compiler parser bug affecting gcc13/nvcc 12.6
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffburdick authored Nov 4, 2024
1 parent f60fac1 commit e96d057
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/matx/core/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ bool SizesMatch(const Op1 &op1, const Op2 &op2) {

template <typename T1, typename T2, typename T3>
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ auto madd( const T1 &x, const T2 &y, const T3 &z) {
using T4 = decltype(x*y+z);
// CUDA 12.6 with gcc 13 is reporting a parsing bug with the expression below. Use an alternative form.
// using T4 = decltype(x*y+z);
using T4 = std::invoke_result_t<decltype(std::plus<>{}), decltype(std::multiplies<>{}(x, y)), decltype(z)>;
if constexpr (is_complex_v<T4> && !is_complex_half_v<T4>) {

using value_type = typename T4::value_type;
Expand Down

0 comments on commit e96d057

Please sign in to comment.