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
94e3a2e4
Commit
94e3a2e4
authored
Feb 12, 2022
by
Shucai Xiao
Browse files
change size_t to int
parent
26bd92d8
Changes
256
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
75 additions
and
75 deletions
+75
-75
test/verify/test_rnn_3args.cpp
test/verify/test_rnn_3args.cpp
+5
-5
test/verify/test_rnn_4args.cpp
test/verify/test_rnn_4args.cpp
+5
-5
test/verify/test_rnn_5args.cpp
test/verify/test_rnn_5args.cpp
+5
-5
test/verify/test_rnn_bi_3args.cpp
test/verify/test_rnn_bi_3args.cpp
+5
-5
test/verify/test_rnn_bidirectional.cpp
test/verify/test_rnn_bidirectional.cpp
+5
-5
test/verify/test_rnn_bidirectional10.cpp
test/verify/test_rnn_bidirectional10.cpp
+5
-5
test/verify/test_rnn_forward.cpp
test/verify/test_rnn_forward.cpp
+5
-5
test/verify/test_rnn_forward10.cpp
test/verify/test_rnn_forward10.cpp
+5
-5
test/verify/test_rnn_reverse.cpp
test/verify/test_rnn_reverse.cpp
+5
-5
test/verify/test_rnn_reverse2.cpp
test/verify/test_rnn_reverse2.cpp
+5
-5
test/verify/test_rnn_sql_1.cpp
test/verify/test_rnn_sql_1.cpp
+5
-5
test/verify/test_rnn_sql_2.cpp
test/verify/test_rnn_sql_2.cpp
+5
-5
test/verify/test_rsqrt.cpp
test/verify/test_rsqrt.cpp
+1
-1
test/verify/test_var_sl_gru_bidirct.cpp
test/verify/test_var_sl_gru_bidirct.cpp
+5
-5
test/verify/test_var_sl_gru_forward.cpp
test/verify/test_var_sl_gru_forward.cpp
+5
-5
tools/api.py
tools/api.py
+4
-4
No files found.
test/verify/test_rnn_3args.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_3args : verify_program<test_rnn_3args>
...
@@ -12,11 +12,11 @@ struct test_rnn_3args : verify_program<test_rnn_3args>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
1
;
in
t
seq_len
=
1
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_4args.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_4args : verify_program<test_rnn_4args>
...
@@ -12,11 +12,11 @@ struct test_rnn_4args : verify_program<test_rnn_4args>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
5
;
in
t
seq_len
=
5
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_5args.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_5args : verify_program<test_rnn_5args>
...
@@ -12,11 +12,11 @@ struct test_rnn_5args : verify_program<test_rnn_5args>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
10
;
in
t
seq_len
=
10
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_bi_3args.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_bi_3args : verify_program<test_rnn_bi_3args>
...
@@ -12,11 +12,11 @@ struct test_rnn_bi_3args : verify_program<test_rnn_bi_3args>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
10
;
in
t
seq_len
=
10
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
2
;
in
t
num_dirct
=
2
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_bidirectional.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_bidirectional : verify_program<test_rnn_bidirectional>
...
@@ -12,11 +12,11 @@ struct test_rnn_bidirectional : verify_program<test_rnn_bidirectional>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
1
;
in
t
seq_len
=
1
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
2
;
in
t
num_dirct
=
2
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_bidirectional10.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_bidirectional10 : verify_program<test_rnn_bidirectional10>
...
@@ -12,11 +12,11 @@ struct test_rnn_bidirectional10 : verify_program<test_rnn_bidirectional10>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
10
;
in
t
seq_len
=
10
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
2
;
in
t
num_dirct
=
2
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_forward.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_forward : verify_program<test_rnn_forward>
...
@@ -12,11 +12,11 @@ struct test_rnn_forward : verify_program<test_rnn_forward>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
1
;
in
t
seq_len
=
1
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_forward10.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_forward10 : verify_program<test_rnn_forward10>
...
@@ -12,11 +12,11 @@ struct test_rnn_forward10 : verify_program<test_rnn_forward10>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
10
;
in
t
seq_len
=
10
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_reverse.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_reverse : verify_program<test_rnn_reverse>
...
@@ -12,11 +12,11 @@ struct test_rnn_reverse : verify_program<test_rnn_reverse>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
1
;
in
t
seq_len
=
1
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_reverse2.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_reverse2 : verify_program<test_rnn_reverse2>
...
@@ -12,11 +12,11 @@ struct test_rnn_reverse2 : verify_program<test_rnn_reverse2>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
2
;
in
t
seq_len
=
2
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_sql_1.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_sql_1 : verify_program<test_rnn_sql_1>
...
@@ -12,11 +12,11 @@ struct test_rnn_sql_1 : verify_program<test_rnn_sql_1>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
10
;
in
t
seq_len
=
10
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rnn_sql_2.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_rnn_sql_2 : verify_program<test_rnn_sql_2>
...
@@ -12,11 +12,11 @@ struct test_rnn_sql_2 : verify_program<test_rnn_sql_2>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
2
;
in
t
batch_size
=
2
;
std
::
size_
t
seq_len
=
10
;
in
t
seq_len
=
10
;
std
::
size_
t
hidden_size
=
4
;
in
t
hidden_size
=
4
;
std
::
size_
t
input_size
=
3
;
in
t
input_size
=
3
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_rsqrt.cpp
View file @
94e3a2e4
...
@@ -10,7 +10,7 @@ struct test_rsqrt : verify_program<test_rsqrt>
...
@@ -10,7 +10,7 @@ struct test_rsqrt : verify_program<test_rsqrt>
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
std
::
vector
<
size_
t
>
input_lens
{
1
,
3
,
16
,
16
};
std
::
vector
<
in
t
>
input_lens
{
1
,
3
,
16
,
16
};
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
input_lens
};
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
input_lens
};
auto
x
=
mm
->
add_parameter
(
"x"
,
s
);
auto
x
=
mm
->
add_parameter
(
"x"
,
s
);
auto
min_val
=
mm
->
add_literal
(
1.0
f
);
auto
min_val
=
mm
->
add_literal
(
1.0
f
);
...
...
test/verify/test_var_sl_gru_bidirct.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_var_sl_gru_bidirct : verify_program<test_var_sl_gru_bidirct>
...
@@ -12,11 +12,11 @@ struct test_var_sl_gru_bidirct : verify_program<test_var_sl_gru_bidirct>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
3
;
in
t
batch_size
=
3
;
std
::
size_
t
seq_len
=
3
;
in
t
seq_len
=
3
;
std
::
size_
t
hidden_size
=
5
;
in
t
hidden_size
=
5
;
std
::
size_
t
input_size
=
8
;
in
t
input_size
=
8
;
std
::
size_
t
num_dirct
=
2
;
in
t
num_dirct
=
2
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/verify/test_var_sl_gru_forward.cpp
View file @
94e3a2e4
...
@@ -12,11 +12,11 @@ struct test_var_sl_gru_forward : verify_program<test_var_sl_gru_forward>
...
@@ -12,11 +12,11 @@ struct test_var_sl_gru_forward : verify_program<test_var_sl_gru_forward>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
std
::
size_
t
batch_size
=
3
;
in
t
batch_size
=
3
;
std
::
size_
t
seq_len
=
3
;
in
t
seq_len
=
3
;
std
::
size_
t
hidden_size
=
5
;
in
t
hidden_size
=
5
;
std
::
size_
t
input_size
=
8
;
in
t
input_size
=
8
;
std
::
size_
t
num_dirct
=
1
;
in
t
num_dirct
=
1
;
float
clip
=
0.0
f
;
float
clip
=
0.0
f
;
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
tools/api.py
View file @
94e3a2e4
...
@@ -217,9 +217,9 @@ class Parameter:
...
@@ -217,9 +217,9 @@ class Parameter:
self
.
size_cparam
=
len
(
self
.
cparams
)
self
.
size_cparam
=
len
(
self
.
cparams
)
self
.
size_name
=
name
or
self
.
name
+
'_size'
self
.
size_name
=
name
or
self
.
name
+
'_size'
if
self
.
returns
:
if
self
.
returns
:
self
.
add_param
(
'
size_
t *'
,
self
.
size_name
)
self
.
add_param
(
'
in
t *'
,
self
.
size_name
)
else
:
else
:
self
.
add_param
(
'
size_
t'
,
self
.
size_name
)
self
.
add_param
(
'
in
t'
,
self
.
size_name
)
def
bad_param
(
self
,
cond
:
str
,
msg
:
str
)
->
None
:
def
bad_param
(
self
,
cond
:
str
,
msg
:
str
)
->
None
:
self
.
bad_param_check
=
BadParam
(
cond
,
msg
)
self
.
bad_param_check
=
BadParam
(
cond
,
msg
)
...
@@ -325,7 +325,7 @@ class Function:
...
@@ -325,7 +325,7 @@ class Function:
def
share_params
(
self
)
->
None
:
def
share_params
(
self
)
->
None
:
if
self
.
shared_size
==
True
:
if
self
.
shared_size
==
True
:
size_param_name
=
'size'
size_param_name
=
'size'
size_type
=
Type
(
'
size_
t'
)
size_type
=
Type
(
'
in
t'
)
for
param
in
self
.
params
:
for
param
in
self
.
params
:
p
=
param
.
remove_size_param
(
size_param_name
)
p
=
param
.
remove_size_param
(
size_param_name
)
if
p
:
if
p
:
...
@@ -796,7 +796,7 @@ def string_c_wrap(p: Parameter) -> None:
...
@@ -796,7 +796,7 @@ def string_c_wrap(p: Parameter) -> None:
p
.
write
=
[
'*${name} = ${result}.c_str()'
]
p
.
write
=
[
'*${name} = ${result}.c_str()'
]
else
:
else
:
p
.
add_param
(
t
)
p
.
add_param
(
t
)
p
.
add_param
(
'
size_
t'
,
p
.
name
+
'_size'
)
p
.
add_param
(
'
in
t'
,
p
.
name
+
'_size'
)
p
.
bad_param
(
'${name} == nullptr'
,
'Null pointer'
)
p
.
bad_param
(
'${name} == nullptr'
,
'Null pointer'
)
p
.
cpp_write
=
'${type}(${name})'
p
.
cpp_write
=
'${type}(${name})'
p
.
write
=
[
p
.
write
=
[
...
...
Prev
1
…
9
10
11
12
13
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