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
a6e8172c
"official/projects/nhnet/utils.py" did not exist on "52371ffe93d0b111e7d3e6f42796fe19b33cb3c2"
Commit
a6e8172c
authored
Aug 16, 2018
by
Paul
Browse files
Formatting
parent
5aa0ba49
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
18 deletions
+19
-18
src/include/migraph/generate.hpp
src/include/migraph/generate.hpp
+12
-12
src/program.cpp
src/program.cpp
+2
-2
src/targets/gpu/eliminate_workspace.cpp
src/targets/gpu/eliminate_workspace.cpp
+2
-2
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+3
-2
No files found.
src/include/migraph/generate.hpp
View file @
a6e8172c
...
...
@@ -7,26 +7,26 @@
namespace
migraph
{
template
<
class
T
>
template
<
class
T
>
struct
xorshf96_generator
{
unsigned
long
x
=
123456789
;
unsigned
long
y
=
362436069
;
unsigned
long
z
=
521288629
;
unsigned
long
x
=
123456789
;
unsigned
long
y
=
362436069
;
unsigned
long
z
=
521288629
;
constexpr
T
operator
()()
{
unsigned
long
t
=
0
;
x
^=
x
<<
16
;
x
^=
x
>>
5
;
x
^=
x
<<
1
;
x
^=
x
<<
16
;
x
^=
x
>>
5
;
x
^=
x
<<
1
;
t
=
x
;
x
=
y
;
y
=
z
;
z
=
t
^
x
^
y
;
t
=
x
;
x
=
y
;
y
=
z
;
z
=
t
^
x
^
y
;
return
z
;
return
z
;
}
};
...
...
src/program.cpp
View file @
a6e8172c
...
...
@@ -247,7 +247,7 @@ void program::compile(const target& t)
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
std
::
cout
<<
*
this
<<
std
::
endl
;
#ifndef NDEBUG
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
std
::
cout
<<
"Validate ..."
<<
std
::
endl
;
auto
invalid
=
this
->
validate
();
if
(
invalid
!=
impl
->
instructions
.
end
())
...
...
@@ -256,7 +256,7 @@ void program::compile(const target& t)
MIGRAPH_THROW
(
p
.
name
()
+
" pass produces invalid program at instruction "
+
std
::
to_string
(
index
)
+
": "
+
invalid
->
op
.
name
());
}
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
if
(
enabled
(
MIGRAPH_TRACE_COMPILE
{}))
std
::
cout
<<
std
::
endl
;
#endif
}
...
...
src/targets/gpu/eliminate_workspace.cpp
View file @
a6e8172c
...
...
@@ -21,14 +21,14 @@ void eliminate_workspace::apply(program& p) const
if
(
ins
->
op
.
name
()
!=
"hip::allocate"
)
continue
;
auto
&&
a
=
any_cast
<
hip_allocate
>
(
ins
->
op
);
if
(
a
.
tag
==
"workspace"
)
if
(
a
.
tag
==
"workspace"
)
{
n
=
std
::
max
(
n
,
ins
->
get_shape
().
bytes
());
allocs
.
push_back
(
ins
);
}
}
auto
ws
=
p
.
add_parameter
(
"workspace"
,
shape
{
shape
::
int8_type
,
{
n
}});
for
(
auto
&&
a
:
allocs
)
for
(
auto
&&
a
:
allocs
)
{
p
.
replace_instruction
(
a
,
ws
);
p
.
remove_instruction
(
a
);
...
...
src/targets/gpu/lowering.cpp
View file @
a6e8172c
...
...
@@ -125,7 +125,8 @@ struct miopen_convolution
workspace_size
,
false
);
algo
=
perf
.
fwd_algo
;
return
algo
==
miopenConvolutionFwdAlgoWinograd
?
shape
{
shape
::
int8_type
,
{
0
}}
:
workspace_shape
;
return
algo
==
miopenConvolutionFwdAlgoWinograd
?
shape
{
shape
::
int8_type
,
{
0
}}
:
workspace_shape
;
}
};
...
...
@@ -332,7 +333,7 @@ struct miopen_apply
}
}
instruction_ref
insert_allocation
(
instruction_ref
ins
,
const
shape
&
s
,
std
::
string
tag
=
""
)
instruction_ref
insert_allocation
(
instruction_ref
ins
,
const
shape
&
s
,
std
::
string
tag
=
""
)
{
if
(
ins
==
--
prog
->
end
())
{
...
...
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