Commit 9f45ab49 authored by Paul's avatar Paul
Browse files

Update static_assert

parent 49dd34f8
...@@ -178,5 +178,9 @@ MIGRAPHX_HIP_NORETURN inline __host__ __device__ void assert_fail(const source_l ...@@ -178,5 +178,9 @@ MIGRAPHX_HIP_NORETURN inline __host__ __device__ void assert_fail(const source_l
#define MIGRAPHX_WARN(...) #define MIGRAPHX_WARN(...)
#endif #endif
#define MIGRAPHX_STATIC_ASSERT_FOR(...) \
static_assert(__VA_ARGS__); \
if constexpr(__VA_ARGS__)
} // namespace migraphx } // namespace migraphx
#endif // MIGRAPHX_GUARD_KERNELS_DEBUG_HPP #endif // MIGRAPHX_GUARD_KERNELS_DEBUG_HPP
...@@ -180,15 +180,17 @@ struct index ...@@ -180,15 +180,17 @@ struct index
} }
else else
{ {
static_assert(max_stride_iterations(n, stride) < 64); MIGRAPHX_STATIC_ASSERT_FOR(max_stride_iterations(n, stride) < 256)
sequence(max_stride_iterations(n, stride), [&](auto... ks) { {
fold([&](auto d, auto k) { sequence(max_stride_iterations(n, stride), [&](auto... ks) {
auto i = start + stride * k; fold([&](auto d, auto k) {
if(i < n) auto i = start + stride * k;
invoke_loop(f, i, d); if(i < n)
return d + _c<1>; invoke_loop(f, i, d);
})(_c<0>, ks...); return d + _c<1>;
}); })(_c<0>, ks...);
});
}
} }
} }
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment