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
af7dd944
"src/include/vscode:/vscode.git/clone" did not exist on "647d79086a08dbeb82f3659094a93ca0c7727190"
Commit
af7dd944
authored
Jun 19, 2023
by
Artur Wojcik
Browse files
math
parent
08111cae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
8 deletions
+6
-8
src/cpp_generator.cpp
src/cpp_generator.cpp
+2
-2
src/include/migraphx/op/isnan.hpp
src/include/migraphx/op/isnan.hpp
+1
-1
src/include/migraphx/verify.hpp
src/include/migraphx/verify.hpp
+2
-4
src/program.cpp
src/program.cpp
+1
-1
No files found.
src/cpp_generator.cpp
View file @
af7dd944
...
...
@@ -213,13 +213,13 @@ cpp_generator::function cpp_generator::generate_module(const module& m,
ins
->
get_literal
().
visit
([
&
](
auto
v
)
{
assert
(
v
.
size
()
==
1
);
auto
x
=
v
.
front
();
if
(
std
::
isinf
(
x
))
if
(
std
::
isinf
(
static_cast
<
double
>
(
x
)
))
{
string_literal
=
"__builtin_huge_val()"
;
if
(
x
<
0
)
string_literal
=
"-__builtin_huge_val()"
;
}
else
if
(
std
::
isnan
(
x
))
else
if
(
std
::
isnan
(
static_cast
<
double
>
(
x
)
))
string_literal
=
"__builtin_nan()"
;
else
string_literal
=
ins
->
get_literal
().
to_string
();
...
...
src/include/migraphx/op/isnan.hpp
View file @
af7dd944
...
...
@@ -35,7 +35,7 @@ struct isnan : unary<isnan>
{
auto
apply
()
const
{
return
[](
auto
x
)
{
return
std
::
isnan
(
x
);
};
return
[](
auto
x
)
{
return
std
::
isnan
(
static_cast
<
double
>
(
x
)
);
};
}
std
::
string
name
()
const
{
return
"isnan"
;
}
...
...
src/include/migraphx/verify.hpp
View file @
af7dd944
...
...
@@ -87,8 +87,7 @@ struct not_finite_fn
template
<
class
T
>
bool
operator
()(
T
x
)
const
{
using
std
::
isfinite
;
return
not
isfinite
(
x
);
return
not
std
::
isfinite
(
static_cast
<
double
>
(
x
));
}
};
static
constexpr
not_finite_fn
not_finite
{};
...
...
@@ -98,8 +97,7 @@ struct compare_mag_fn
template
<
class
T
,
class
U
>
bool
operator
()(
T
x
,
U
y
)
const
{
using
std
::
fabs
;
return
fabs
(
x
)
<
fabs
(
y
);
return
std
::
fabs
(
x
)
<
std
::
fabs
(
y
);
}
};
static
constexpr
compare_mag_fn
compare_mag
{};
...
...
src/program.cpp
View file @
af7dd944
...
...
@@ -346,7 +346,7 @@ void program::finalize()
template
<
class
T
>
std
::
string
classify
(
T
x
)
{
switch
(
std
::
fpclassify
(
x
))
switch
(
std
::
fpclassify
(
static_cast
<
double
>
(
x
)
))
{
case
FP_INFINITE
:
return
"inf"
;
case
FP_NAN
:
return
"nan"
;
...
...
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