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
53870e3b
Commit
53870e3b
authored
Sep 09, 2022
by
Paul
Browse files
Add more asserts
parent
b7902fa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/targets/gpu/kernels/include/migraphx/kernels/index.hpp
src/targets/gpu/kernels/include/migraphx/kernels/index.hpp
+6
-1
No files found.
src/targets/gpu/kernels/include/migraphx/kernels/index.hpp
View file @
53870e3b
...
@@ -72,7 +72,7 @@ inline __device__ __attribute__((const)) index_int compute_local_size()
...
@@ -72,7 +72,7 @@ inline __device__ __attribute__((const)) index_int compute_local_size()
#ifdef MIGRAPHX_NGROUP
#ifdef MIGRAPHX_NGROUP
// If global is divisible by local then local can be a const
// If global is divisible by local then local can be a const
#if(MIGRAPHX_NGLOBAL % MIGRAPHX_NLOCAL == 0) || (MIGRAPHX_NGROUP == 1)
#if(MIGRAPHX_NGLOBAL % MIGRAPHX_NLOCAL == 0) || (MIGRAPHX_NGROUP == 1)
#define MIGRAPHX_CONST_LOCAL 1
#define MIGRAPHX_
HAS_
CONST_LOCAL 1
#endif
#endif
#endif
#endif
...
@@ -87,6 +87,7 @@ struct index
...
@@ -87,6 +87,7 @@ struct index
#else
#else
__device__
index_int
nglobal
()
const
__device__
index_int
nglobal
()
const
{
{
MIGRAPHX_ASSERT
(
compute_global_size
()
>
0
);
return
compute_global_size
();
// NOLINT
return
compute_global_size
();
// NOLINT
}
}
#endif
#endif
...
@@ -96,6 +97,10 @@ struct index
...
@@ -96,6 +97,10 @@ struct index
#else
#else
__device__
index_int
nlocal
()
const
__device__
index_int
nlocal
()
const
{
{
#ifdef MIGRAPHX_NGROUP
static_assert
((
MIGRAPHX_NGLOBAL
%
MIGRAPHX_NLOCAL
!=
0
)
and
(
MIGRAPHX_NGROUP
>
1
),
"Local should be const"
);
#endif
MIGRAPHX_ASSERT
(
compute_local_size
()
>
0
);
return
compute_local_size
();
// NOLINT
return
compute_local_size
();
// NOLINT
}
}
#endif
#endif
...
...
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