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,7 +180,8 @@ struct index ...@@ -180,7 +180,8 @@ 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) { sequence(max_stride_iterations(n, stride), [&](auto... ks) {
fold([&](auto d, auto k) { fold([&](auto d, auto k) {
auto i = start + stride * k; auto i = start + stride * k;
...@@ -191,6 +192,7 @@ struct index ...@@ -191,6 +192,7 @@ struct index
}); });
} }
} }
}
else else
{ {
index_int k = 0; index_int k = 0;
......
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