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
6aec7033
"testing/vscode:/vscode.git/clone" did not exist on "61ee0bec35956d0b07b6f6fdba2b4d3a83781991"
Commit
6aec7033
authored
Nov 14, 2023
by
Umang Yadav
Browse files
fix test for neg inf
parent
ba471f44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
test/fp8e5m2.cpp
test/fp8e5m2.cpp
+6
-4
No files found.
test/fp8e5m2.cpp
View file @
6aec7033
...
@@ -414,12 +414,14 @@ TEST_CASE(test_isfinite)
...
@@ -414,12 +414,14 @@ TEST_CASE(test_isfinite)
{
{
EXPECT
(
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
0.0
)));
EXPECT
(
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
0.0
)));
EXPECT
(
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
-
0.0
)));
EXPECT
(
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
-
0.0
)));
EXPECT
(
not
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
std
::
numeric_limits
<
migraphx
::
fp8
::
fp8e5m2
>::
infinity
())));
EXPECT
(
not
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
-
1.0
*
std
::
numeric_limits
<
migraphx
::
fp8
::
fp8e5m2
>::
infinity
())));
EXPECT
(
not
std
::
isfinite
(
EXPECT
(
not
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
std
::
numeric_limits
<
migraphx
::
fp8
::
fp8e5m2
>::
quiet_NaN
())));
migraphx
::
fp8
::
fp8e5m2
(
std
::
numeric_limits
<
migraphx
::
fp8
::
fp8e5m2
>::
quiet_NaN
())));
EXPECT
(
not
std
::
isfinite
(
std
::
numeric_limits
<
migraphx
::
fp8
::
fp8e5m2
>::
infinity
()));
// -1.0 * inf is float(-inf) which with clipping/saturation gets converted into fp8::lowest()
EXPECT
(
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
-
1.0
*
std
::
numeric_limits
<
migraphx
::
fp8
::
fp8e5m2
>::
infinity
())));
// fp8(-neg_inf)
EXPECT
(
not
std
::
isfinite
(
migraphx
::
fp8
::
fp8e5m2
(
0xFC
,
migraphx
::
fp8
::
fp8e5m2
::
from_bits
())));
}
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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