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
ec4d023a
"test/vscode:/vscode.git/clone" did not exist on "7a7040aa668362cb9db35c30b73bc816301a466d"
Commit
ec4d023a
authored
Aug 20, 2018
by
Paul
Browse files
Fix ambiguity
parent
3ee7e6b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/include/migraph/generate.hpp
src/include/migraph/generate.hpp
+5
-5
No files found.
src/include/migraph/generate.hpp
View file @
ec4d023a
...
...
@@ -8,15 +8,15 @@
namespace
migraph
{
template
<
class
T
,
MIGRAPH_REQUIRES
(
std
::
is_floating_point
<
T
>{})
>
T
normalize
(
T
z
)
T
normalize
(
unsigned
long
z
)
{
if
(
z
==
0
)
return
0
;
return
(
2.0
/
z
)
-
1.0
;
}
template
<
class
T
,
MIGRAPH_REQUIRES
(
std
::
is_signed
<
T
>{})
>
T
normalize
(
T
z
)
template
<
class
T
,
MIGRAPH_REQUIRES
(
std
::
is_signed
<
T
>{}
and
not
std
::
is_floating_point
<
T
>
{}
)
>
T
normalize
(
unsigned
long
z
)
{
const
auto
max
=
std
::
numeric_limits
<
T
>::
max
();
const
auto
half_max
=
max
/
2
;
...
...
@@ -24,7 +24,7 @@ T normalize(T z)
}
template
<
class
T
,
MIGRAPH_REQUIRES
(
not
std
::
is_signed
<
T
>{}
and
std
::
is_integral
<
T
>
{})
>
T
normalize
(
T
z
)
T
normalize
(
unsigned
long
z
)
{
const
auto
max
=
std
::
numeric_limits
<
T
>::
max
();
return
z
%
max
;
...
...
@@ -48,7 +48,7 @@ struct xorshf96_generator
y
=
z
;
z
=
t
^
x
^
y
;
return
normalize
(
z
);
return
normalize
<
T
>
(
z
);
}
};
...
...
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