Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
9f45ab49
Commit
9f45ab49
authored
Jan 26, 2023
by
Paul
Browse files
Update static_assert
parent
49dd34f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
src/targets/gpu/kernels/include/migraphx/kernels/debug.hpp
src/targets/gpu/kernels/include/migraphx/kernels/debug.hpp
+4
-0
src/targets/gpu/kernels/include/migraphx/kernels/index.hpp
src/targets/gpu/kernels/include/migraphx/kernels/index.hpp
+11
-9
No files found.
src/targets/gpu/kernels/include/migraphx/kernels/debug.hpp
View file @
9f45ab49
...
@@ -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
src/targets/gpu/kernels/include/migraphx/kernels/index.hpp
View file @
9f45ab49
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment