Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
f292aa44
Commit
f292aa44
authored
May 06, 2019
by
Khalique
Browse files
Merge branch 'develop' of
https://github.com/ROCmSoftwarePlatform/AMDMIGraphX
into depthwise_conv
parents
cc320df0
a713a6d3
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
6 deletions
+46
-6
test/gpu/adjust_allocation.cpp
test/gpu/adjust_allocation.cpp
+5
-3
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+31
-3
test/onnx/clip_test.onnx
test/onnx/clip_test.onnx
+0
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+10
-0
No files found.
test/gpu/adjust_allocation.cpp
View file @
f292aa44
...
...
@@ -8,6 +8,7 @@
#include <migraphx/iterator_for.hpp>
#include <migraphx/op/add.hpp>
#include <migraphx/op/transpose.hpp>
#include <migraphx/op/contiguous.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/pass_manager.hpp>
#include <migraphx/op/tanh.hpp>
...
...
@@ -37,7 +38,8 @@ TEST_CASE(tanh_shape)
auto
x
=
p
.
add_parameter
(
"x"
,
s
);
auto
tx
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
1
,
0
}},
x
);
auto
txh
=
p
.
add_instruction
(
migraphx
::
op
::
tanh
{},
tx
);
p
.
add_instruction
(
migraphx
::
op
::
add
{},
txh
,
txh
);
auto
sum
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
txh
,
txh
);
p
.
add_instruction
(
migraphx
::
op
::
contiguous
{},
sum
);
return
p
;
};
...
...
@@ -55,8 +57,8 @@ TEST_CASE(tanh_shape)
{
if
(
ins
->
name
()
==
"hip::allocate"
)
{
migraphx
::
shape
wrong
_s
{
migraphx
::
shape
::
float_type
,
{
3
,
2
},
{
1
,
3
}};
ins
->
replace
(
wrong_s
);
migraphx
::
shape
new
_s
{
migraphx
::
shape
::
float_type
,
{
3
,
2
},
{
1
,
3
}};
migraphx
::
instruction
::
replace
(
ins
,
ins
->
get_operator
(),
new_s
,
ins
->
inputs
()
);
}
}
EXPECT
(
p1
!=
p2
);
...
...
test/gpu/miopen.cpp
View file @
f292aa44
...
...
@@ -333,7 +333,22 @@ struct test_trans_tanh : verify_program<test_trans_tanh>
auto
x
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}});
auto
tx
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
x
);
auto
tanhx
=
p
.
add_instruction
(
migraphx
::
op
::
tanh
{},
tx
);
p
.
add_instruction
(
migraphx
::
op
::
add
{},
tanhx
,
tanhx
);
auto
r
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
tanhx
,
tanhx
);
p
.
add_instruction
(
migraphx
::
op
::
contiguous
{},
r
);
return
p
;
}
};
struct
test_slice_sin
:
verify_program
<
test_slice_sin
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
l
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
2
}});
auto
t
=
p
.
add_instruction
(
migraphx
::
op
::
slice
{{
1
},
{
1
},
{
2
}},
l
);
p
.
add_instruction
(
migraphx
::
op
::
sin
{},
t
);
return
p
;
}
};
...
...
@@ -692,8 +707,10 @@ struct test_trans_abs : verify_program<test_trans_abs>
migraphx
::
program
p
;
auto
x
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}});
auto
tx
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
x
);
auto
tanhx
=
p
.
add_instruction
(
migraphx
::
op
::
abs
{},
tx
);
p
.
add_instruction
(
migraphx
::
op
::
add
{},
tanhx
,
tanhx
);
auto
absx
=
p
.
add_instruction
(
migraphx
::
op
::
abs
{},
tx
);
auto
r
=
p
.
add_instruction
(
migraphx
::
op
::
add
{},
absx
,
absx
);
p
.
add_instruction
(
migraphx
::
op
::
contiguous
{},
r
);
return
p
;
}
};
...
...
@@ -1309,6 +1326,17 @@ struct test_batchnorm_inference : verify_program<test_batchnorm_inference>
}
};
struct
test_clip
:
verify_program
<
test_clip
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
x
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
}});
p
.
add_instruction
(
migraphx
::
op
::
clip
{
6.0
,
0.0
},
x
);
return
p
;
}
};
struct
test_conv_bn
:
verify_program
<
test_conv_bn
>
{
migraphx
::
program
create_program
()
const
...
...
test/onnx/clip_test.onnx
0 → 100644
View file @
f292aa44
File added
test/onnx/onnx_test.cpp
View file @
f292aa44
...
...
@@ -794,4 +794,14 @@ TEST_CASE(no_pad_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
clip_test
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
}});
p
.
add_instruction
(
migraphx
::
op
::
clip
{
6.0
,
0.0
},
l0
);
auto
prog
=
migraphx
::
parse_onnx
(
"clip_test.onnx"
);
EXPECT
(
p
==
prog
);
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
Prev
1
2
Next
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