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
composable_kernel
Commits
12aacfe9
Commit
12aacfe9
authored
Sep 12, 2022
by
Po-Yen, Chen
Browse files
Use span<> to generalize check_err() interface
parent
3fdff5bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
library/include/ck/library/utility/check_err.hpp
library/include/ck/library/utility/check_err.hpp
+15
-3
No files found.
library/include/ck/library/utility/check_err.hpp
View file @
12aacfe9
...
...
@@ -15,6 +15,7 @@
#include "ck/ck.hpp"
#include "ck/utility/data_type.hpp"
#include "ck/utility/span.hpp"
#include "ck/utility/type.hpp"
#include "ck/host_utility/io.hpp"
...
...
@@ -108,9 +109,9 @@ check_err(const std::vector<T>& out,
}
template
<
typename
T
>
typename
std
::
enable_if
<
std
::
is_same
<
T
,
half_t
>
::
value
,
bool
>::
type
check_err
(
const
std
::
vector
<
T
>
&
out
,
const
std
::
vector
<
T
>
&
ref
,
typename
std
::
enable_if
<
std
::
is_same
_v
<
std
::
remove_cv_t
<
T
>
,
half_t
>
,
bool
>::
type
check_err
(
span
<
T
>
out
,
span
<
T
>
ref
,
const
std
::
string
&
msg
=
"Error: Incorrect results!"
,
double
rtol
=
1e-3
,
double
atol
=
1e-3
)
...
...
@@ -150,6 +151,17 @@ check_err(const std::vector<T>& out,
return
res
;
}
template
<
typename
T
>
typename
std
::
enable_if
<
std
::
is_same
<
T
,
half_t
>::
value
,
bool
>::
type
check_err
(
const
std
::
vector
<
T
>&
out
,
const
std
::
vector
<
T
>&
ref
,
const
std
::
string
&
msg
=
"Error: Incorrect results!"
,
double
rtol
=
1e-3
,
double
atol
=
1e-3
)
{
return
check_err
(
span
<
const
T
>
{
out
},
span
<
const
T
>
{
ref
},
msg
,
rtol
,
atol
);
}
template
<
typename
T
>
std
::
enable_if_t
<
(
std
::
is_integral_v
<
T
>
&&
!
std
::
is_same_v
<
T
,
bhalf_t
>
)
#ifdef CK_EXPERIMENTAL_BIT_INT_EXTENSION_INT4
...
...
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