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
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
913 additions
and
94 deletions
+913
-94
src/analyze_streams.cpp
src/analyze_streams.cpp
+5
-5
src/api/api.cpp
src/api/api.cpp
+14
-14
src/api/include/migraphx/migraphx.h
src/api/include/migraphx/migraphx.h
+10
-10
src/api/include/migraphx/migraphx.hpp
src/api/include/migraphx/migraphx.hpp
+27
-27
src/argument.cpp
src/argument.cpp
+7
-7
src/cpp_generator.cpp
src/cpp_generator.cpp
+1
-1
src/dead_code_elimination.cpp
src/dead_code_elimination.cpp
+1
-1
src/driver/alexnet.cpp
src/driver/alexnet.cpp
+1
-1
src/driver/inceptionv3.cpp
src/driver/inceptionv3.cpp
+1
-1
src/driver/main.cpp
src/driver/main.cpp
+3
-3
src/driver/models.hpp
src/driver/models.hpp
+3
-3
src/driver/resnet50.cpp
src/driver/resnet50.cpp
+1
-1
src/driver/verify.cpp
src/driver/verify.cpp
+3
-3
src/dynamic_loader.cpp
src/dynamic_loader.cpp
+2
-2
src/eliminate_allocation.cpp
src/eliminate_allocation.cpp
+2
-2
src/eliminate_pad.cpp
src/eliminate_pad.cpp
+9
-9
src/env.cpp
src/env.cpp
+1
-1
src/file_buffer.cpp
src/file_buffer.cpp
+1
-1
src/files
src/files
+819
-0
src/fuse_pointwise.cpp
src/fuse_pointwise.cpp
+2
-2
No files found.
src/analyze_streams.cpp
View file @
94e3a2e4
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
bool
happens_before
(
const
std
::
vector
<
std
::
size_
t
>&
e1
,
const
std
::
vector
<
std
::
size_
t
>&
e2
)
bool
happens_before
(
const
std
::
vector
<
in
t
>&
e1
,
const
std
::
vector
<
in
t
>&
e2
)
{
{
return
std
::
equal
(
e1
.
begin
(),
e1
.
end
(),
e2
.
begin
(),
e2
.
end
(),
std
::
less_equal
<>
{})
and
return
std
::
equal
(
e1
.
begin
(),
e1
.
end
(),
e2
.
begin
(),
e2
.
end
(),
std
::
less_equal
<>
{})
and
not
std
::
equal
(
e1
.
begin
(),
e1
.
end
(),
e2
.
begin
(),
e2
.
end
(),
std
::
greater_equal
<>
{});
not
std
::
equal
(
e1
.
begin
(),
e1
.
end
(),
e2
.
begin
(),
e2
.
end
(),
std
::
greater_equal
<>
{});
...
@@ -16,17 +16,17 @@ bool happens_before(const std::vector<std::size_t>& e1, const std::vector<std::s
...
@@ -16,17 +16,17 @@ bool happens_before(const std::vector<std::size_t>& e1, const std::vector<std::s
std
::
vector
<
stream_race
>
analyze_streams
(
const
module
&
p
,
const
stream_model
&
m
)
std
::
vector
<
stream_race
>
analyze_streams
(
const
module
&
p
,
const
stream_model
&
m
)
{
{
using
vector_clock
=
std
::
vector
<
std
::
size_
t
>
;
using
vector_clock
=
std
::
vector
<
in
t
>
;
std
::
vector
<
stream_race
>
races
;
std
::
vector
<
stream_race
>
races
;
auto
nstream
=
m
.
get_nstream
();
auto
nstream
=
m
.
get_nstream
();
std
::
vector
<
vector_clock
>
vclock
(
nstream
,
vector_clock
(
nstream
));
std
::
vector
<
vector_clock
>
vclock
(
nstream
,
vector_clock
(
nstream
));
std
::
unordered_map
<
instruction_ref
,
vector_clock
>
timestamp
;
std
::
unordered_map
<
instruction_ref
,
vector_clock
>
timestamp
;
std
::
unordered_map
<
std
::
size_
t
,
vector_clock
>
events
;
std
::
unordered_map
<
in
t
,
vector_clock
>
events
;
for
(
auto
ins
:
iterator_for
(
p
))
for
(
auto
ins
:
iterator_for
(
p
))
{
{
if
(
not
m
.
has_stream
(
ins
))
if
(
not
m
.
has_stream
(
ins
))
continue
;
continue
;
std
::
size_
t
s
=
m
.
get_stream
(
ins
);
in
t
s
=
m
.
get_stream
(
ins
);
assert
(
s
<
nstream
);
assert
(
s
<
nstream
);
assert
(
vclock
.
size
()
==
nstream
);
assert
(
vclock
.
size
()
==
nstream
);
assert
(
vclock
[
s
].
size
()
==
nstream
);
assert
(
vclock
[
s
].
size
()
==
nstream
);
...
@@ -63,7 +63,7 @@ std::vector<stream_race> analyze_streams(const module& p, const stream_model& m)
...
@@ -63,7 +63,7 @@ std::vector<stream_race> analyze_streams(const module& p, const stream_model& m)
continue
;
continue
;
if
(
ins
->
inputs
().
empty
())
if
(
ins
->
inputs
().
empty
())
continue
;
continue
;
std
::
size_
t
s
=
m
.
get_stream
(
ins
);
in
t
s
=
m
.
get_stream
(
ins
);
// Find inputs from different streams
// Find inputs from different streams
std
::
vector
<
instruction_ref
>
inputs
;
std
::
vector
<
instruction_ref
>
inputs
;
fix
([
&
](
auto
self
,
auto
start
)
{
fix
([
&
](
auto
self
,
auto
start
)
{
...
...
src/api/api.cpp
View file @
94e3a2e4
...
@@ -96,12 +96,12 @@ void set_default_dim_value(tf_options& options, size_t value) { options.batch_si
...
@@ -96,12 +96,12 @@ void set_default_dim_value(tf_options& options, size_t value) { options.batch_si
void
set_input_parameter_shape
(
onnx_options
&
options
,
void
set_input_parameter_shape
(
onnx_options
&
options
,
const
char
*
name
,
const
char
*
name
,
std
::
vector
<
std
::
size_
t
>
dims
)
std
::
vector
<
in
t
>
dims
)
{
{
options
.
map_input_dims
[
std
::
string
(
name
)]
=
std
::
move
(
dims
);
options
.
map_input_dims
[
std
::
string
(
name
)]
=
std
::
move
(
dims
);
}
}
void
set_input_parameter_shape
(
tf_options
&
options
,
const
char
*
name
,
std
::
vector
<
std
::
size_
t
>
dims
)
void
set_input_parameter_shape
(
tf_options
&
options
,
const
char
*
name
,
std
::
vector
<
in
t
>
dims
)
{
{
options
.
map_input_dims
[
std
::
string
(
name
)]
=
std
::
move
(
dims
);
options
.
map_input_dims
[
std
::
string
(
name
)]
=
std
::
move
(
dims
);
}
}
...
@@ -388,7 +388,7 @@ extern "C" migraphx_status migraphx_shape_destroy(migraphx_shape_t shape)
...
@@ -388,7 +388,7 @@ extern "C" migraphx_status migraphx_shape_destroy(migraphx_shape_t shape)
extern
"C"
migraphx_status
migraphx_shape_create
(
migraphx_shape_t
*
shape
,
extern
"C"
migraphx_status
migraphx_shape_create
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
migraphx_shape_datatype_t
type
,
size_t
*
lengths
,
size_t
*
lengths
,
size_
t
lengths_size
)
in
t
lengths_size
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
lengths
==
nullptr
and
lengths_size
!=
0
)
if
(
lengths
==
nullptr
and
lengths_size
!=
0
)
...
@@ -403,9 +403,9 @@ extern "C" migraphx_status migraphx_shape_create(migraphx_shape_t* shape,
...
@@ -403,9 +403,9 @@ extern "C" migraphx_status migraphx_shape_create(migraphx_shape_t* shape,
extern
"C"
migraphx_status
migraphx_shape_create_with_strides
(
migraphx_shape_t
*
shape
,
extern
"C"
migraphx_status
migraphx_shape_create_with_strides
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
migraphx_shape_datatype_t
type
,
size_t
*
lengths
,
size_t
*
lengths
,
size_
t
lengths_size
,
in
t
lengths_size
,
size_t
*
strides
,
size_t
*
strides
,
size_
t
strides_size
)
in
t
strides_size
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
lengths
==
nullptr
and
lengths_size
!=
0
)
if
(
lengths
==
nullptr
and
lengths_size
!=
0
)
...
@@ -431,7 +431,7 @@ extern "C" migraphx_status migraphx_shape_create_scalar(migraphx_shape_t* shape,
...
@@ -431,7 +431,7 @@ extern "C" migraphx_status migraphx_shape_create_scalar(migraphx_shape_t* shape,
}
}
extern
"C"
migraphx_status
extern
"C"
migraphx_status
migraphx_shape_lengths
(
const
size_
t
**
out
,
size_
t
*
out_size
,
const_migraphx_shape_t
shape
)
migraphx_shape_lengths
(
const
in
t
**
out
,
in
t
*
out_size
,
const_migraphx_shape_t
shape
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
out
==
nullptr
or
out_size
==
nullptr
)
if
(
out
==
nullptr
or
out_size
==
nullptr
)
...
@@ -446,7 +446,7 @@ migraphx_shape_lengths(const size_t** out, size_t* out_size, const_migraphx_shap
...
@@ -446,7 +446,7 @@ migraphx_shape_lengths(const size_t** out, size_t* out_size, const_migraphx_shap
}
}
extern
"C"
migraphx_status
extern
"C"
migraphx_status
migraphx_shape_strides
(
const
size_
t
**
out
,
size_
t
*
out_size
,
const_migraphx_shape_t
shape
)
migraphx_shape_strides
(
const
in
t
**
out
,
in
t
*
out_size
,
const_migraphx_shape_t
shape
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
out
==
nullptr
or
out_size
==
nullptr
)
if
(
out
==
nullptr
or
out_size
==
nullptr
)
...
@@ -847,7 +847,7 @@ extern "C" migraphx_status migraphx_operation_create(migraphx_operation_t* opera
...
@@ -847,7 +847,7 @@ extern "C" migraphx_status migraphx_operation_create(migraphx_operation_t* opera
}
}
extern
"C"
migraphx_status
extern
"C"
migraphx_status
migraphx_operation_name
(
char
*
out
,
size_
t
out_size
,
migraphx_operation_t
operation
)
migraphx_operation_name
(
char
*
out
,
in
t
out_size
,
migraphx_operation_t
operation
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
out
==
nullptr
)
if
(
out
==
nullptr
)
...
@@ -855,7 +855,7 @@ migraphx_operation_name(char* out, size_t out_size, migraphx_operation_t operati
...
@@ -855,7 +855,7 @@ migraphx_operation_name(char* out, size_t out_size, migraphx_operation_t operati
if
(
operation
==
nullptr
)
if
(
operation
==
nullptr
)
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter operation: Null pointer"
);
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter operation: Null pointer"
);
auto
&&
api_result
=
(
operation
->
object
).
name
();
auto
&&
api_result
=
(
operation
->
object
).
name
();
auto
*
it
=
std
::
copy_n
(
api_result
.
begin
(),
std
::
min
(
api_result
.
size
(),
out_size
-
1
),
out
);
auto
*
it
=
std
::
copy_n
(
api_result
.
begin
(),
std
::
min
(
static_cast
<
int
>
(
api_result
.
size
()
)
,
out_size
-
1
),
out
);
*
it
=
'\0'
;
*
it
=
'\0'
;
});
});
return
api_error_result
;
return
api_error_result
;
...
@@ -900,7 +900,7 @@ extern "C" migraphx_status migraphx_onnx_options_create(migraphx_onnx_options_t*
...
@@ -900,7 +900,7 @@ extern "C" migraphx_status migraphx_onnx_options_create(migraphx_onnx_options_t*
}
}
extern
"C"
migraphx_status
migraphx_onnx_options_set_input_parameter_shape
(
extern
"C"
migraphx_status
migraphx_onnx_options_set_input_parameter_shape
(
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
size_t
*
dims
,
size_
t
dims_size
)
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
size_t
*
dims
,
in
t
dims_size
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
onnx_options
==
nullptr
)
if
(
onnx_options
==
nullptr
)
...
@@ -908,7 +908,7 @@ extern "C" migraphx_status migraphx_onnx_options_set_input_parameter_shape(
...
@@ -908,7 +908,7 @@ extern "C" migraphx_status migraphx_onnx_options_set_input_parameter_shape(
if
(
dims
==
nullptr
and
dims_size
!=
0
)
if
(
dims
==
nullptr
and
dims_size
!=
0
)
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter dims: Null pointer"
);
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter dims: Null pointer"
);
migraphx
::
set_input_parameter_shape
(
migraphx
::
set_input_parameter_shape
(
(
onnx_options
->
object
),
(
name
),
(
std
::
vector
<
size_
t
>
(
dims
,
dims
+
dims_size
)));
(
onnx_options
->
object
),
(
name
),
(
std
::
vector
<
in
t
>
(
dims
,
dims
+
dims_size
)));
});
});
return
api_error_result
;
return
api_error_result
;
}
}
...
@@ -1053,7 +1053,7 @@ extern "C" migraphx_status migraphx_tf_options_set_nhwc(migraphx_tf_options_t tf
...
@@ -1053,7 +1053,7 @@ extern "C" migraphx_status migraphx_tf_options_set_nhwc(migraphx_tf_options_t tf
}
}
extern
"C"
migraphx_status
migraphx_tf_options_set_input_parameter_shape
(
extern
"C"
migraphx_status
migraphx_tf_options_set_input_parameter_shape
(
migraphx_tf_options_t
tf_options
,
const
char
*
name
,
size_
t
*
dims
,
size_
t
dims_size
)
migraphx_tf_options_t
tf_options
,
const
char
*
name
,
in
t
*
dims
,
in
t
dims_size
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
tf_options
==
nullptr
)
if
(
tf_options
==
nullptr
)
...
@@ -1061,7 +1061,7 @@ extern "C" migraphx_status migraphx_tf_options_set_input_parameter_shape(
...
@@ -1061,7 +1061,7 @@ extern "C" migraphx_status migraphx_tf_options_set_input_parameter_shape(
if
(
dims
==
nullptr
and
dims_size
!=
0
)
if
(
dims
==
nullptr
and
dims_size
!=
0
)
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter dims: Null pointer"
);
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter dims: Null pointer"
);
migraphx
::
set_input_parameter_shape
(
migraphx
::
set_input_parameter_shape
(
(
tf_options
->
object
),
(
name
),
(
std
::
vector
<
size_
t
>
(
dims
,
dims
+
dims_size
)));
(
tf_options
->
object
),
(
name
),
(
std
::
vector
<
in
t
>
(
dims
,
dims
+
dims_size
)));
});
});
return
api_error_result
;
return
api_error_result
;
}
}
...
@@ -1079,7 +1079,7 @@ migraphx_tf_options_set_default_dim_value(migraphx_tf_options_t tf_options, size
...
@@ -1079,7 +1079,7 @@ migraphx_tf_options_set_default_dim_value(migraphx_tf_options_t tf_options, size
extern
"C"
migraphx_status
migraphx_tf_options_set_output_names
(
migraphx_tf_options_t
tf_options
,
extern
"C"
migraphx_status
migraphx_tf_options_set_output_names
(
migraphx_tf_options_t
tf_options
,
const
char
**
names
,
const
char
**
names
,
size_
t
names_size
)
in
t
names_size
)
{
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
tf_options
==
nullptr
)
if
(
tf_options
==
nullptr
)
...
...
src/api/include/migraphx/migraphx.h
View file @
94e3a2e4
...
@@ -94,23 +94,23 @@ migraphx_status migraphx_shape_destroy(migraphx_shape_t shape);
...
@@ -94,23 +94,23 @@ migraphx_status migraphx_shape_destroy(migraphx_shape_t shape);
migraphx_status
migraphx_shape_create
(
migraphx_shape_t
*
shape
,
migraphx_status
migraphx_shape_create
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
migraphx_shape_datatype_t
type
,
size_t
*
lengths
,
size_t
*
lengths
,
size_
t
lengths_size
);
in
t
lengths_size
);
migraphx_status
migraphx_shape_create_with_strides
(
migraphx_shape_t
*
shape
,
migraphx_status
migraphx_shape_create_with_strides
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
migraphx_shape_datatype_t
type
,
size_t
*
lengths
,
size_t
*
lengths
,
size_
t
lengths_size
,
in
t
lengths_size
,
size_t
*
strides
,
size_t
*
strides
,
size_
t
strides_size
);
in
t
strides_size
);
migraphx_status
migraphx_shape_create_scalar
(
migraphx_shape_t
*
shape
,
migraphx_status
migraphx_shape_create_scalar
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
);
migraphx_shape_datatype_t
type
);
migraphx_status
migraphx_status
migraphx_shape_lengths
(
const
size_
t
**
out
,
size_
t
*
out_size
,
const_migraphx_shape_t
shape
);
migraphx_shape_lengths
(
const
in
t
**
out
,
in
t
*
out_size
,
const_migraphx_shape_t
shape
);
migraphx_status
migraphx_status
migraphx_shape_strides
(
const
size_
t
**
out
,
size_
t
*
out_size
,
const_migraphx_shape_t
shape
);
migraphx_shape_strides
(
const
in
t
**
out
,
in
t
*
out_size
,
const_migraphx_shape_t
shape
);
migraphx_status
migraphx_shape_type
(
migraphx_shape_datatype_t
*
out
,
const_migraphx_shape_t
shape
);
migraphx_status
migraphx_shape_type
(
migraphx_shape_datatype_t
*
out
,
const_migraphx_shape_t
shape
);
...
@@ -212,7 +212,7 @@ migraphx_status migraphx_operation_create(migraphx_operation_t* operation,
...
@@ -212,7 +212,7 @@ migraphx_status migraphx_operation_create(migraphx_operation_t* operation,
const
char
*
attributes
,
const
char
*
attributes
,
...);
...);
migraphx_status
migraphx_operation_name
(
char
*
out
,
size_
t
out_size
,
migraphx_operation_t
operation
);
migraphx_status
migraphx_operation_name
(
char
*
out
,
in
t
out_size
,
migraphx_operation_t
operation
);
migraphx_status
migraphx_status
migraphx_load
(
migraphx_program_t
*
out
,
const
char
*
name
,
migraphx_file_options_t
options
);
migraphx_load
(
migraphx_program_t
*
out
,
const
char
*
name
,
migraphx_file_options_t
options
);
...
@@ -225,7 +225,7 @@ migraphx_status migraphx_onnx_options_destroy(migraphx_onnx_options_t onnx_optio
...
@@ -225,7 +225,7 @@ migraphx_status migraphx_onnx_options_destroy(migraphx_onnx_options_t onnx_optio
migraphx_status
migraphx_onnx_options_create
(
migraphx_onnx_options_t
*
onnx_options
);
migraphx_status
migraphx_onnx_options_create
(
migraphx_onnx_options_t
*
onnx_options
);
migraphx_status
migraphx_onnx_options_set_input_parameter_shape
(
migraphx_status
migraphx_onnx_options_set_input_parameter_shape
(
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
size_t
*
dims
,
size_
t
dims_size
);
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
size_t
*
dims
,
in
t
dims_size
);
migraphx_status
migraphx_onnx_options_set_default_dim_value
(
migraphx_onnx_options_t
onnx_options
,
migraphx_status
migraphx_onnx_options_set_default_dim_value
(
migraphx_onnx_options_t
onnx_options
,
size_t
value
);
size_t
value
);
...
@@ -267,15 +267,15 @@ migraphx_status migraphx_tf_options_set_nhwc(migraphx_tf_options_t tf_options, b
...
@@ -267,15 +267,15 @@ migraphx_status migraphx_tf_options_set_nhwc(migraphx_tf_options_t tf_options, b
migraphx_status
migraphx_tf_options_set_input_parameter_shape
(
migraphx_tf_options_t
tf_options
,
migraphx_status
migraphx_tf_options_set_input_parameter_shape
(
migraphx_tf_options_t
tf_options
,
const
char
*
name
,
const
char
*
name
,
size_
t
*
dims
,
in
t
*
dims
,
size_
t
dims_size
);
in
t
dims_size
);
migraphx_status
migraphx_tf_options_set_default_dim_value
(
migraphx_tf_options_t
tf_options
,
migraphx_status
migraphx_tf_options_set_default_dim_value
(
migraphx_tf_options_t
tf_options
,
size_t
value
);
size_t
value
);
migraphx_status
migraphx_tf_options_set_output_names
(
migraphx_tf_options_t
tf_options
,
migraphx_status
migraphx_tf_options_set_output_names
(
migraphx_tf_options_t
tf_options
,
const
char
**
names
,
const
char
**
names
,
size_
t
names_size
);
in
t
names_size
);
migraphx_status
migraphx_status
migraphx_parse_tf
(
migraphx_program_t
*
out
,
const
char
*
name
,
migraphx_tf_options_t
options
);
migraphx_parse_tf
(
migraphx_program_t
*
out
,
const
char
*
name
,
migraphx_tf_options_t
options
);
...
...
src/api/include/migraphx/migraphx.hpp
View file @
94e3a2e4
...
@@ -37,7 +37,7 @@ void call(F f, Ts&&... xs)
...
@@ -37,7 +37,7 @@ void call(F f, Ts&&... xs)
throw
std
::
runtime_error
(
"Failed to call function"
);
throw
std
::
runtime_error
(
"Failed to call function"
);
}
}
template
<
class
F
,
class
Iterator
=
std
::
size_
t
>
template
<
class
F
,
class
Iterator
=
in
t
>
struct
iota_iterator
struct
iota_iterator
{
{
Iterator
index
;
Iterator
index
;
...
@@ -230,14 +230,14 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
...
@@ -230,14 +230,14 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
/// Construct a shape with its type and lengths. The strides are
/// Construct a shape with its type and lengths. The strides are
/// automatically computed assumming a packed layout.
/// automatically computed assumming a packed layout.
shape
(
migraphx_shape_datatype_t
type
,
std
::
vector
<
size_
t
>
plengths
)
shape
(
migraphx_shape_datatype_t
type
,
std
::
vector
<
in
t
>
plengths
)
{
{
this
->
make_handle
(
&
migraphx_shape_create
,
type
,
plengths
.
data
(),
plengths
.
size
());
this
->
make_handle
(
&
migraphx_shape_create
,
type
,
plengths
.
data
(),
plengths
.
size
());
}
}
shape
(
migraphx_shape_datatype_t
type
,
shape
(
migraphx_shape_datatype_t
type
,
std
::
vector
<
size_
t
>
plengths
,
std
::
vector
<
in
t
>
plengths
,
std
::
vector
<
size_
t
>
pstrides
)
std
::
vector
<
in
t
>
pstrides
)
{
{
this
->
make_handle
(
&
migraphx_shape_create_with_strides
,
this
->
make_handle
(
&
migraphx_shape_create_with_strides
,
type
,
type
,
...
@@ -247,18 +247,18 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
...
@@ -247,18 +247,18 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
pstrides
.
size
());
pstrides
.
size
());
}
}
std
::
vector
<
size_
t
>
lengths
()
const
std
::
vector
<
in
t
>
lengths
()
const
{
{
const
size_
t
*
pout
;
const
in
t
*
pout
;
size_
t
pout_size
;
in
t
pout_size
;
call
(
&
migraphx_shape_lengths
,
&
pout
,
&
pout_size
,
this
->
get_handle_ptr
());
call
(
&
migraphx_shape_lengths
,
&
pout
,
&
pout_size
,
this
->
get_handle_ptr
());
return
{
pout
,
pout
+
pout_size
};
return
{
pout
,
pout
+
pout_size
};
}
}
std
::
vector
<
size_
t
>
strides
()
const
std
::
vector
<
in
t
>
strides
()
const
{
{
const
size_
t
*
pout
;
const
in
t
*
pout
;
size_
t
pout_size
;
in
t
pout_size
;
call
(
&
migraphx_shape_strides
,
&
pout
,
&
pout_size
,
this
->
get_handle_ptr
());
call
(
&
migraphx_shape_strides
,
&
pout
,
&
pout_size
,
this
->
get_handle_ptr
());
return
{
pout
,
pout
+
pout_size
};
return
{
pout
,
pout
+
pout_size
};
}
}
...
@@ -270,9 +270,9 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
...
@@ -270,9 +270,9 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
return
pout
;
return
pout
;
}
}
size_
t
bytes
()
const
in
t
bytes
()
const
{
{
size_
t
pout
;
in
t
pout
;
call
(
&
migraphx_shape_bytes
,
&
pout
,
this
->
get_handle_ptr
());
call
(
&
migraphx_shape_bytes
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
return
pout
;
}
}
...
@@ -323,7 +323,7 @@ struct argument : MIGRAPHX_CONST_HANDLE_BASE(argument)
...
@@ -323,7 +323,7 @@ struct argument : MIGRAPHX_CONST_HANDLE_BASE(argument)
}
}
/// Generate an argument using random data
/// Generate an argument using random data
static
argument
generate
(
shape
ps
,
size_
t
pseed
=
0
)
static
argument
generate
(
shape
ps
,
in
t
pseed
=
0
)
{
{
return
{
make
<
migraphx_argument
>
(
&
migraphx_argument_generate
,
ps
.
get_handle_ptr
(),
pseed
),
return
{
make
<
migraphx_argument
>
(
&
migraphx_argument_generate
,
ps
.
get_handle_ptr
(),
pseed
),
own
{}};
own
{}};
...
@@ -366,9 +366,9 @@ struct program_parameter_shapes : MIGRAPHX_HANDLE_BASE(program_parameter_shapes)
...
@@ -366,9 +366,9 @@ struct program_parameter_shapes : MIGRAPHX_HANDLE_BASE(program_parameter_shapes)
this
->
set_handle
(
p
,
borrow
{});
this
->
set_handle
(
p
,
borrow
{});
}
}
size_
t
size
()
const
in
t
size
()
const
{
{
size_
t
pout
;
in
t
pout
;
call
(
&
migraphx_program_parameter_shapes_size
,
&
pout
,
this
->
get_handle_ptr
());
call
(
&
migraphx_program_parameter_shapes_size
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
return
pout
;
}
}
...
@@ -426,14 +426,14 @@ struct arguments : MIGRAPHX_HANDLE_BASE(arguments), array_base<arguments>
...
@@ -426,14 +426,14 @@ struct arguments : MIGRAPHX_HANDLE_BASE(arguments), array_base<arguments>
arguments
(
migraphx_arguments
*
p
,
borrow
)
{
this
->
set_handle
(
p
,
borrow
{});
}
arguments
(
migraphx_arguments
*
p
,
borrow
)
{
this
->
set_handle
(
p
,
borrow
{});
}
size_
t
size
()
const
in
t
size
()
const
{
{
size_
t
pout
;
in
t
pout
;
call
(
&
migraphx_arguments_size
,
&
pout
,
this
->
get_handle_ptr
());
call
(
&
migraphx_arguments_size
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
return
pout
;
}
}
argument
operator
[](
size_
t
pidx
)
const
argument
operator
[](
in
t
pidx
)
const
{
{
const_migraphx_argument_t
pout
;
const_migraphx_argument_t
pout
;
call
(
&
migraphx_arguments_get
,
&
pout
,
this
->
get_handle_ptr
(),
pidx
);
call
(
&
migraphx_arguments_get
,
&
pout
,
this
->
get_handle_ptr
(),
pidx
);
...
@@ -443,7 +443,7 @@ struct arguments : MIGRAPHX_HANDLE_BASE(arguments), array_base<arguments>
...
@@ -443,7 +443,7 @@ struct arguments : MIGRAPHX_HANDLE_BASE(arguments), array_base<arguments>
struct
iterator_read
struct
iterator_read
{
{
migraphx_arguments
*
self
;
migraphx_arguments
*
self
;
argument
operator
()(
size_
t
pidx
)
const
argument
operator
()(
in
t
pidx
)
const
{
{
const_migraphx_argument_t
pout
;
const_migraphx_argument_t
pout
;
call
(
&
migraphx_arguments_get
,
&
pout
,
self
,
pidx
);
call
(
&
migraphx_arguments_get
,
&
pout
,
self
,
pidx
);
...
@@ -459,14 +459,14 @@ struct shapes : MIGRAPHX_HANDLE_BASE(shapes), array_base<shapes>
...
@@ -459,14 +459,14 @@ struct shapes : MIGRAPHX_HANDLE_BASE(shapes), array_base<shapes>
shapes
(
migraphx_shapes
*
p
,
borrow
)
{
this
->
set_handle
(
p
,
borrow
{});
}
shapes
(
migraphx_shapes
*
p
,
borrow
)
{
this
->
set_handle
(
p
,
borrow
{});
}
size_
t
size
()
const
in
t
size
()
const
{
{
size_
t
pout
;
in
t
pout
;
call
(
&
migraphx_shapes_size
,
&
pout
,
this
->
get_handle_ptr
());
call
(
&
migraphx_shapes_size
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
return
pout
;
}
}
shape
operator
[](
size_
t
pidx
)
const
shape
operator
[](
in
t
pidx
)
const
{
{
const_migraphx_shape_t
pout
;
const_migraphx_shape_t
pout
;
call
(
&
migraphx_shapes_get
,
&
pout
,
this
->
get_handle_ptr
(),
pidx
);
call
(
&
migraphx_shapes_get
,
&
pout
,
this
->
get_handle_ptr
(),
pidx
);
...
@@ -476,7 +476,7 @@ struct shapes : MIGRAPHX_HANDLE_BASE(shapes), array_base<shapes>
...
@@ -476,7 +476,7 @@ struct shapes : MIGRAPHX_HANDLE_BASE(shapes), array_base<shapes>
struct
iterator_read
struct
iterator_read
{
{
migraphx_shapes
*
self
;
migraphx_shapes
*
self
;
shape
operator
()(
size_
t
pidx
)
const
shape
operator
()(
in
t
pidx
)
const
{
{
const_migraphx_shape_t
pout
;
const_migraphx_shape_t
pout
;
call
(
&
migraphx_shapes_get
,
&
pout
,
self
,
pidx
);
call
(
&
migraphx_shapes_get
,
&
pout
,
self
,
pidx
);
...
@@ -661,7 +661,7 @@ struct onnx_options : MIGRAPHX_HANDLE_BASE(onnx_options)
...
@@ -661,7 +661,7 @@ struct onnx_options : MIGRAPHX_HANDLE_BASE(onnx_options)
onnx_options
(
migraphx_onnx_options
*
p
,
own
)
{
this
->
set_handle
(
p
,
own
{});
}
onnx_options
(
migraphx_onnx_options
*
p
,
own
)
{
this
->
set_handle
(
p
,
own
{});
}
/// Make onnx parser treat an inputs with a certain dimensions
/// Make onnx parser treat an inputs with a certain dimensions
void
set_input_parameter_shape
(
const
std
::
string
&
name
,
std
::
vector
<
std
::
size_
t
>
dim
)
void
set_input_parameter_shape
(
const
std
::
string
&
name
,
std
::
vector
<
in
t
>
dim
)
{
{
call
(
&
migraphx_onnx_options_set_input_parameter_shape
,
call
(
&
migraphx_onnx_options_set_input_parameter_shape
,
this
->
get_handle_ptr
(),
this
->
get_handle_ptr
(),
...
@@ -700,7 +700,7 @@ inline program parse_onnx(const char* filename)
...
@@ -700,7 +700,7 @@ inline program parse_onnx(const char* filename)
/// Parse a buffer of memory as an onnx file
/// Parse a buffer of memory as an onnx file
inline
program
inline
program
parse_onnx_buffer
(
const
void
*
data
,
size_
t
size
,
const
migraphx
::
onnx_options
&
options
)
parse_onnx_buffer
(
const
void
*
data
,
in
t
size
,
const
migraphx
::
onnx_options
&
options
)
{
{
return
program
(
return
program
(
make
<
migraphx_program
>
(
&
migraphx_parse_onnx_buffer
,
data
,
size
,
options
.
get_handle_ptr
()),
make
<
migraphx_program
>
(
&
migraphx_parse_onnx_buffer
,
data
,
size
,
options
.
get_handle_ptr
()),
...
@@ -708,7 +708,7 @@ parse_onnx_buffer(const void* data, size_t size, const migraphx::onnx_options& o
...
@@ -708,7 +708,7 @@ parse_onnx_buffer(const void* data, size_t size, const migraphx::onnx_options& o
}
}
/// Parse a buffer of memory as an onnx file
/// Parse a buffer of memory as an onnx file
inline
program
parse_onnx_buffer
(
const
void
*
data
,
size_
t
size
)
inline
program
parse_onnx_buffer
(
const
void
*
data
,
in
t
size
)
{
{
migraphx
::
onnx_options
options
;
migraphx
::
onnx_options
options
;
return
program
(
return
program
(
...
@@ -743,7 +743,7 @@ struct tf_options : MIGRAPHX_HANDLE_BASE(tf_options)
...
@@ -743,7 +743,7 @@ struct tf_options : MIGRAPHX_HANDLE_BASE(tf_options)
tf_options
(
migraphx_tf_options
*
p
,
own
)
{
this
->
set_handle
(
p
,
own
{});
}
tf_options
(
migraphx_tf_options
*
p
,
own
)
{
this
->
set_handle
(
p
,
own
{});
}
/// Make tf parser treat an inputs with a certain dimensions
/// Make tf parser treat an inputs with a certain dimensions
void
set_input_parameter_shape
(
const
std
::
string
&
name
,
std
::
vector
<
std
::
size_
t
>
dim
)
void
set_input_parameter_shape
(
const
std
::
string
&
name
,
std
::
vector
<
in
t
>
dim
)
{
{
call
(
&
migraphx_tf_options_set_input_parameter_shape
,
call
(
&
migraphx_tf_options_set_input_parameter_shape
,
this
->
get_handle_ptr
(),
this
->
get_handle_ptr
(),
...
...
src/argument.cpp
View file @
94e3a2e4
...
@@ -27,10 +27,10 @@ void argument::assign_buffer(std::function<char*()> d)
...
@@ -27,10 +27,10 @@ void argument::assign_buffer(std::function<char*()> d)
return
;
return
;
}
}
// Collect all shapes
// Collect all shapes
std
::
unordered_map
<
std
::
size_
t
,
shape
>
shapes
;
std
::
unordered_map
<
in
t
,
shape
>
shapes
;
{
{
// cppcheck-suppress variableScope
// cppcheck-suppress variableScope
std
::
size_
t
i
=
0
;
in
t
i
=
0
;
fix
([
&
](
auto
self
,
auto
ss
)
{
fix
([
&
](
auto
self
,
auto
ss
)
{
if
(
ss
.
sub_shapes
().
empty
())
if
(
ss
.
sub_shapes
().
empty
())
{
{
...
@@ -45,14 +45,14 @@ void argument::assign_buffer(std::function<char*()> d)
...
@@ -45,14 +45,14 @@ void argument::assign_buffer(std::function<char*()> d)
})(
s
);
})(
s
);
}
}
// Sort by type size
// Sort by type size
std
::
vector
<
std
::
size_
t
>
order
(
shapes
.
size
());
std
::
vector
<
in
t
>
order
(
shapes
.
size
());
std
::
iota
(
order
.
begin
(),
order
.
end
(),
0
);
std
::
iota
(
order
.
begin
(),
order
.
end
(),
0
);
std
::
sort
(
order
.
begin
(),
order
.
end
(),
by
(
std
::
greater
<>
{},
[
&
](
auto
i
)
{
std
::
sort
(
order
.
begin
(),
order
.
end
(),
by
(
std
::
greater
<>
{},
[
&
](
auto
i
)
{
return
shapes
[
i
].
type_size
();
return
shapes
[
i
].
type_size
();
}));
}));
// Compute offsets
// Compute offsets
std
::
unordered_map
<
std
::
size_t
,
std
::
size_
t
>
offsets
;
std
::
unordered_map
<
int
,
in
t
>
offsets
;
std
::
size_
t
offset
=
0
;
in
t
offset
=
0
;
for
(
auto
i
:
order
)
for
(
auto
i
:
order
)
{
{
offsets
[
i
]
=
offset
;
offsets
[
i
]
=
offset
;
...
@@ -61,7 +61,7 @@ void argument::assign_buffer(std::function<char*()> d)
...
@@ -61,7 +61,7 @@ void argument::assign_buffer(std::function<char*()> d)
assert
(
offset
==
s
.
bytes
());
assert
(
offset
==
s
.
bytes
());
// cppcheck-suppress variableScope
// cppcheck-suppress variableScope
std
::
size_
t
i
=
0
;
in
t
i
=
0
;
m_data
=
fix
<
data_t
>
([
&
](
auto
self
,
auto
ss
)
{
m_data
=
fix
<
data_t
>
([
&
](
auto
self
,
auto
ss
)
{
data_t
result
;
data_t
result
;
if
(
ss
.
sub_shapes
().
empty
())
if
(
ss
.
sub_shapes
().
empty
())
...
@@ -155,7 +155,7 @@ std::vector<argument> argument::get_sub_objects() const
...
@@ -155,7 +155,7 @@ std::vector<argument> argument::get_sub_objects() const
return
result
;
return
result
;
}
}
argument
argument
::
element
(
std
::
size_
t
i
)
const
argument
argument
::
element
(
in
t
i
)
const
{
{
assert
(
this
->
get_shape
().
sub_shapes
().
empty
());
assert
(
this
->
get_shape
().
sub_shapes
().
empty
());
auto
idx
=
this
->
get_shape
().
index
(
i
);
auto
idx
=
this
->
get_shape
().
index
(
i
);
...
...
src/cpp_generator.cpp
View file @
94e3a2e4
...
@@ -86,7 +86,7 @@ cpp_generator::function& cpp_generator::function::set_generic_types(const module
...
@@ -86,7 +86,7 @@ cpp_generator::function& cpp_generator::function::set_generic_types(const module
struct
cpp_generator_impl
struct
cpp_generator_impl
{
{
std
::
stringstream
fs
{};
std
::
stringstream
fs
{};
std
::
size_
t
function_count
=
0
;
in
t
function_count
=
0
;
std
::
function
<
std
::
string
(
std
::
string
)
>
fmap
=
nullptr
;
std
::
function
<
std
::
string
(
std
::
string
)
>
fmap
=
nullptr
;
std
::
function
<
std
::
string
(
shape
)
>
fresult
=
nullptr
;
std
::
function
<
std
::
string
(
shape
)
>
fresult
=
nullptr
;
std
::
unordered_map
<
std
::
string
,
std
::
string
>
point_op_map
=
{};
std
::
unordered_map
<
std
::
string
,
std
::
string
>
point_op_map
=
{};
...
...
src/dead_code_elimination.cpp
View file @
94e3a2e4
...
@@ -14,7 +14,7 @@ std::ptrdiff_t bidistance(const Range& r, Iterator start, Iterator last)
...
@@ -14,7 +14,7 @@ std::ptrdiff_t bidistance(const Range& r, Iterator start, Iterator last)
{
{
auto
start_forward
=
start
;
auto
start_forward
=
start
;
auto
start_backwards
=
start
;
auto
start_backwards
=
start
;
std
::
size_
t
n
=
0
;
in
t
n
=
0
;
while
(
start_forward
!=
last
and
start_backwards
!=
last
)
while
(
start_forward
!=
last
and
start_backwards
!=
last
)
{
{
n
++
;
n
++
;
...
...
src/driver/alexnet.cpp
View file @
94e3a2e4
...
@@ -8,7 +8,7 @@ namespace migraphx {
...
@@ -8,7 +8,7 @@ namespace migraphx {
namespace
driver
{
namespace
driver
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
migraphx
::
program
alexnet
(
unsigned
batch
)
// NOLINT(readability-function-size)
migraphx
::
program
alexnet
(
int
batch
)
// NOLINT(readability-function-size)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
...
...
src/driver/inceptionv3.cpp
View file @
94e3a2e4
...
@@ -8,7 +8,7 @@ namespace migraphx {
...
@@ -8,7 +8,7 @@ namespace migraphx {
namespace
driver
{
namespace
driver
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
migraphx
::
program
inceptionv3
(
unsigned
batch
)
// NOLINT(readability-function-size)
migraphx
::
program
inceptionv3
(
int
batch
)
// NOLINT(readability-function-size)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
...
...
src/driver/main.cpp
View file @
94e3a2e4
...
@@ -37,7 +37,7 @@ struct loader
...
@@ -37,7 +37,7 @@ struct loader
std
::
string
model
;
std
::
string
model
;
std
::
string
file
;
std
::
string
file
;
std
::
string
file_type
;
std
::
string
file_type
;
unsigned
batch
=
1
;
int
batch
=
1
;
bool
is_nhwc
=
true
;
bool
is_nhwc
=
true
;
unsigned
trim
=
0
;
unsigned
trim
=
0
;
bool
optimize
=
false
;
bool
optimize
=
false
;
...
@@ -99,7 +99,7 @@ struct loader
...
@@ -99,7 +99,7 @@ struct loader
static
auto
parse_param_dims
(
const
std
::
vector
<
std
::
string
>&
param_dims_info
)
static
auto
parse_param_dims
(
const
std
::
vector
<
std
::
string
>&
param_dims_info
)
{
{
std
::
unordered_map
<
std
::
string
,
std
::
vector
<
std
::
size_
t
>>
map_input_dims
;
std
::
unordered_map
<
std
::
string
,
std
::
vector
<
in
t
>>
map_input_dims
;
std
::
string
name
=
""
;
std
::
string
name
=
""
;
for
(
auto
&&
x
:
param_dims_info
)
for
(
auto
&&
x
:
param_dims_info
)
{
{
...
@@ -109,7 +109,7 @@ struct loader
...
@@ -109,7 +109,7 @@ struct loader
}
}
else
else
{
{
map_input_dims
[
name
].
push_back
(
value_parser
<
std
::
size_
t
>::
apply
(
x
));
map_input_dims
[
name
].
push_back
(
value_parser
<
in
t
>::
apply
(
x
));
}
}
}
}
...
...
src/driver/models.hpp
View file @
94e3a2e4
...
@@ -5,9 +5,9 @@ namespace migraphx {
...
@@ -5,9 +5,9 @@ namespace migraphx {
namespace
driver
{
namespace
driver
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
migraphx
::
program
resnet50
(
unsigned
batch
);
migraphx
::
program
resnet50
(
int
batch
);
migraphx
::
program
inceptionv3
(
unsigned
batch
);
migraphx
::
program
inceptionv3
(
int
batch
);
migraphx
::
program
alexnet
(
unsigned
batch
);
migraphx
::
program
alexnet
(
int
batch
);
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace driver
}
// namespace driver
...
...
src/driver/resnet50.cpp
View file @
94e3a2e4
...
@@ -8,7 +8,7 @@ namespace migraphx {
...
@@ -8,7 +8,7 @@ namespace migraphx {
namespace
driver
{
namespace
driver
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
migraphx
::
program
resnet50
(
unsigned
batch
)
// NOLINT(readability-function-size)
migraphx
::
program
resnet50
(
int
batch
)
// NOLINT(readability-function-size)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
...
...
src/driver/verify.cpp
View file @
94e3a2e4
...
@@ -58,8 +58,8 @@ void verify_program(const std::string& name,
...
@@ -58,8 +58,8 @@ void verify_program(const std::string& name,
auto
x
=
run_ref
(
p
,
inputs
);
auto
x
=
run_ref
(
p
,
inputs
);
auto
y
=
run_target
(
p
,
t
,
options
,
quantize
,
inputs
);
auto
y
=
run_target
(
p
,
t
,
options
,
quantize
,
inputs
);
std
::
size_
t
output_num
=
x
.
size
();
in
t
output_num
=
x
.
size
();
for
(
std
::
size_
t
i
=
0
;
i
<
output_num
;
++
i
)
for
(
in
t
i
=
0
;
i
<
output_num
;
++
i
)
{
{
verify_args
(
name
,
x
[
i
],
y
[
i
],
tolerance
);
verify_args
(
name
,
x
[
i
],
y
[
i
],
tolerance
);
}
}
...
@@ -136,7 +136,7 @@ void verify_reduced_program(const program& p,
...
@@ -136,7 +136,7 @@ void verify_reduced_program(const program& p,
{
{
const
auto
*
mm
=
p
.
get_main_module
();
const
auto
*
mm
=
p
.
get_main_module
();
auto
n
=
std
::
distance
(
mm
->
begin
(),
mm
->
end
());
auto
n
=
std
::
distance
(
mm
->
begin
(),
mm
->
end
());
for
(
std
::
size_
t
i
=
0
;
i
<
n
;
i
++
)
for
(
in
t
i
=
0
;
i
<
n
;
i
++
)
{
{
verify_reduced
(
p
,
i
,
t
,
options
,
quantize
,
inputs
,
tolerance
);
verify_reduced
(
p
,
i
,
t
,
options
,
quantize
,
inputs
,
tolerance
);
}
}
...
...
src/dynamic_loader.cpp
View file @
94e3a2e4
...
@@ -17,7 +17,7 @@ struct dynamic_loader_impl
...
@@ -17,7 +17,7 @@ struct dynamic_loader_impl
{
{
}
}
static
std
::
shared_ptr
<
dynamic_loader_impl
>
from_buffer
(
const
char
*
image
,
std
::
size_
t
size
)
static
std
::
shared_ptr
<
dynamic_loader_impl
>
from_buffer
(
const
char
*
image
,
in
t
size
)
{
{
auto
t
=
std
::
make_shared
<
tmp_dir
>
(
"dloader"
);
auto
t
=
std
::
make_shared
<
tmp_dir
>
(
"dloader"
);
auto
f
=
t
->
path
/
"libtmp.so"
;
auto
f
=
t
->
path
/
"libtmp.so"
;
...
@@ -33,7 +33,7 @@ dynamic_loader::dynamic_loader(const fs::path& p) : impl(std::make_shared<dynami
...
@@ -33,7 +33,7 @@ dynamic_loader::dynamic_loader(const fs::path& p) : impl(std::make_shared<dynami
{
{
}
}
dynamic_loader
::
dynamic_loader
(
const
char
*
image
,
std
::
size_
t
size
)
dynamic_loader
::
dynamic_loader
(
const
char
*
image
,
in
t
size
)
:
impl
(
dynamic_loader_impl
::
from_buffer
(
image
,
size
))
:
impl
(
dynamic_loader_impl
::
from_buffer
(
image
,
size
))
{
{
}
}
...
...
src/eliminate_allocation.cpp
View file @
94e3a2e4
...
@@ -24,8 +24,8 @@ void eliminate_allocation::apply(module& p) const
...
@@ -24,8 +24,8 @@ void eliminate_allocation::apply(module& p) const
if
(
ins
->
name
()
!=
allocation_op
)
if
(
ins
->
name
()
!=
allocation_op
)
continue
;
continue
;
allocs
.
emplace_back
(
ins
,
n
);
allocs
.
emplace_back
(
ins
,
n
);
std
::
size_
t
size
=
ins
->
get_shape
().
bytes
();
in
t
size
=
ins
->
get_shape
().
bytes
();
std
::
size_
t
padding
=
(
alignment
-
(
size
%
alignment
))
%
alignment
;
in
t
padding
=
(
alignment
-
(
size
%
alignment
))
%
alignment
;
n
+=
size
+
padding
;
n
+=
size
+
padding
;
}
}
if
(
n
>
0
)
if
(
n
>
0
)
...
...
src/eliminate_pad.cpp
View file @
94e3a2e4
...
@@ -19,19 +19,19 @@ static void update_op(const instruction_ref& input, const instruction_ref& ins,
...
@@ -19,19 +19,19 @@ static void update_op(const instruction_ref& input, const instruction_ref& ins,
auto
kdims
=
input
->
get_shape
().
lens
().
size
()
-
2
;
auto
kdims
=
input
->
get_shape
().
lens
().
size
()
-
2
;
auto
kdims_it
=
pad_op
.
pads
.
begin
()
+
2
;
auto
kdims_it
=
pad_op
.
pads
.
begin
()
+
2
;
std
::
vector
<
size_
t
>
pads_l
(
kdims_it
,
kdims_it
+
kdims
);
std
::
vector
<
in
t
>
pads_l
(
kdims_it
,
kdims_it
+
kdims
);
std
::
vector
<
size_
t
>
pads_r
(
kdims_it
+
kdims
+
2
,
pad_op
.
pads
.
end
());
std
::
vector
<
in
t
>
pads_r
(
kdims_it
+
kdims
+
2
,
pad_op
.
pads
.
end
());
auto
op
=
ins
->
get_operator
();
auto
op
=
ins
->
get_operator
();
std
::
vector
<
size_
t
>
padding
(
kdims
*
2
,
0
);
std
::
vector
<
in
t
>
padding
(
kdims
*
2
,
0
);
std
::
transform
(
std
::
transform
(
pads_l
.
begin
(),
pads_l
.
end
(),
padding
.
begin
(),
padding
.
begin
(),
std
::
plus
<
size_
t
>
());
pads_l
.
begin
(),
pads_l
.
end
(),
padding
.
begin
(),
padding
.
begin
(),
std
::
plus
<
in
t
>
());
std
::
transform
(
pads_r
.
begin
(),
std
::
transform
(
pads_r
.
begin
(),
pads_r
.
end
(),
pads_r
.
end
(),
padding
.
begin
()
+
kdims
,
padding
.
begin
()
+
kdims
,
padding
.
begin
()
+
kdims
,
padding
.
begin
()
+
kdims
,
std
::
plus
<
size_
t
>
());
std
::
plus
<
in
t
>
());
op
.
from_value
({{
"padding"
,
padding
}});
op
.
from_value
({{
"padding"
,
padding
}});
...
@@ -53,16 +53,16 @@ static void update_pooling(const instruction_ref& input, const instruction_ref&
...
@@ -53,16 +53,16 @@ static void update_pooling(const instruction_ref& input, const instruction_ref&
auto
kdims
=
input
->
get_shape
().
lens
().
size
()
-
2
;
auto
kdims
=
input
->
get_shape
().
lens
().
size
()
-
2
;
auto
kdims_it
=
pad_op
.
pads
.
begin
()
+
2
;
auto
kdims_it
=
pad_op
.
pads
.
begin
()
+
2
;
std
::
vector
<
size_
t
>
pads_l
(
kdims_it
,
kdims_it
+
kdims
);
std
::
vector
<
in
t
>
pads_l
(
kdims_it
,
kdims_it
+
kdims
);
std
::
vector
<
size_
t
>
pads_r
(
kdims_it
+
kdims
+
2
,
pad_op
.
pads
.
end
());
std
::
vector
<
in
t
>
pads_r
(
kdims_it
+
kdims
+
2
,
pad_op
.
pads
.
end
());
std
::
transform
(
std
::
transform
(
pads_l
.
begin
(),
pads_l
.
end
(),
op
.
padding
.
begin
(),
op
.
padding
.
begin
(),
std
::
plus
<
size_
t
>
());
pads_l
.
begin
(),
pads_l
.
end
(),
op
.
padding
.
begin
(),
op
.
padding
.
begin
(),
std
::
plus
<
in
t
>
());
std
::
transform
(
pads_r
.
begin
(),
std
::
transform
(
pads_r
.
begin
(),
pads_r
.
end
(),
pads_r
.
end
(),
op
.
padding
.
begin
()
+
kdims
,
op
.
padding
.
begin
()
+
kdims
,
op
.
padding
.
begin
()
+
kdims
,
op
.
padding
.
begin
()
+
kdims
,
std
::
plus
<
size_
t
>
());
std
::
plus
<
in
t
>
());
std
::
vector
<
instruction_ref
>
new_inputs
{
ins
->
inputs
()};
std
::
vector
<
instruction_ref
>
new_inputs
{
ins
->
inputs
()};
new_inputs
.
front
()
=
input
->
inputs
().
front
();
new_inputs
.
front
()
=
input
->
inputs
().
front
();
...
...
src/env.cpp
View file @
94e3a2e4
...
@@ -21,7 +21,7 @@ bool disabled(const char* name)
...
@@ -21,7 +21,7 @@ bool disabled(const char* name)
return
contains
({
"0"
,
"disable"
,
"disabled"
,
"no"
,
"false"
},
e
.
front
());
return
contains
({
"0"
,
"disable"
,
"disabled"
,
"no"
,
"false"
},
e
.
front
());
}
}
std
::
size_
t
value_of
(
const
char
*
name
,
std
::
size_
t
fallback
)
in
t
value_of
(
const
char
*
name
,
in
t
fallback
)
{
{
auto
e
=
env
(
name
);
auto
e
=
env
(
name
);
if
(
e
.
empty
())
if
(
e
.
empty
())
...
...
src/file_buffer.cpp
View file @
94e3a2e4
...
@@ -31,7 +31,7 @@ std::string read_string(const std::string& filename)
...
@@ -31,7 +31,7 @@ std::string read_string(const std::string& filename)
return
generic_read_file
<
std
::
string
>
(
filename
);
return
generic_read_file
<
std
::
string
>
(
filename
);
}
}
void
write_buffer
(
const
std
::
string
&
filename
,
const
char
*
buffer
,
std
::
size_
t
size
)
void
write_buffer
(
const
std
::
string
&
filename
,
const
char
*
buffer
,
in
t
size
)
{
{
std
::
ofstream
os
(
filename
);
std
::
ofstream
os
(
filename
);
os
.
write
(
buffer
,
size
);
os
.
write
(
buffer
,
size
);
...
...
src/files
0 → 100644
View file @
94e3a2e4
adjust_allocation.cpp
analyze_streams.cpp
api/api.cpp
apply_alpha_beta.cpp
argument.cpp
auto_contiguous.cpp
common.cpp
compile_src.cpp
convert_to_json.cpp
cpp_generator.cpp
dead_code_elimination.cpp
dom_info.cpp
driver/main.cpp
driver/alexnet.cpp
driver/verify.cpp
driver/inceptionv3.cpp
driver/resnet50.cpp
driver/marker_roctx.cpp
driver/perf.cpp
dynamic_loader.cpp
eliminate_allocation.cpp
eliminate_common_subexpression.cpp
eliminate_concat.cpp
eliminate_contiguous.cpp
eliminate_data_type.cpp
eliminate_identity.cpp
eliminate_pad.cpp
env.cpp
file_buffer.cpp
fuse_pointwise.cpp
generate.cpp
include/migraphx/cpp_generator.hpp
inline_module.cpp
insert_pad.cpp
instruction.cpp
json.cpp
load_save.cpp
make_op.cpp
module.cpp
msgpack.cpp
normalize_attributes.cpp
normalize_ops.cpp
onnx/parse_lstm.cpp
onnx/parse_gru.cpp
onnx/parse_squeeze.cpp
onnx/parse_convolution.cpp
onnx/parse_pow.cpp
onnx/parse_randomnormal_ops.cpp
onnx/parse_loop.cpp
onnx/parse_generic_op.cpp
onnx/parse_greaterorequal.cpp
onnx/parse_matmul.cpp
onnx/parse_prefix_scan.cpp
onnx/parse_reshape.cpp
onnx/parse_where.cpp
onnx/parse_constant_of_shape.cpp
onnx/onnx.cpp
onnx/parse_range.cpp
onnx/padding.cpp
onnx/parse_hardsigmoid.cpp
onnx/parse_gather_elements.cpp
onnx/parse_imagescalar.cpp
onnx/parse_transpose.cpp
onnx/parse_arg_op.cpp
onnx/op_parser.cpp
onnx/parse_spacetodepth.cpp
onnx/parse_softmax.cpp
onnx/.parse_softmax.cpp.swp
onnx/parse_deconvolution.cpp
onnx/parse_resize.cpp
onnx/parse_instancenorm.cpp
onnx/parse_dequantizelinear.cpp
onnx/parse_multinomial.cpp
onnx/parse_nonzero.cpp
onnx/parse_quantizelinear.cpp
onnx/parse_lessorequal.cpp
onnx/parse_slice.cpp
onnx/parse_dropout.cpp
onnx/parse_softsign.cpp
onnx/parse_binary_op.cpp
onnx/parse_onehot.cpp
onnx/parse_split.cpp
onnx/parse_shape.cpp
onnx/parse_expand.cpp
onnx/parse_batchnorm.cpp
onnx/parse_constant.cpp
onnx/parse_tile.cpp
onnx/parse_softplus.cpp
onnx/parse_aten.cpp
onnx/parse_pooling.cpp
onnx/parse_gemm.cpp
onnx/parse_cast.cpp
onnx/parse_rnn.cpp
onnx/parse_variadic_op.cpp
onnx/onnx_parser.cpp
onnx/parse_constant_fill.cpp
onnx/parse_roialign.cpp
onnx/parse_reduce_op.cpp
onnx/parse_if.cpp
onnx/parse_clip.cpp
onnx/conv.cpp
onnx/parse_randomuniform_ops.cpp
onnx/parse_selu.cpp
onnx/parse_pad.cpp
onnx/parse_topk.cpp
onnx/parse_mean.cpp
onnx/parse_compare_op.cpp
onnx/map_activation_functions.cpp
onnx/checks.cpp
onnx/parse_depthtospace.cpp
onnx/parse_thresholdedrelu.cpp
operation.cpp
opt/memory_coloring_impl.cpp
opt/memory_coloring.cpp
pass_manager.cpp
permutation.cpp
preallocate_param.cpp
process.cpp
program.cpp
propagate_constant.cpp
py/migraphx_py.cpp
quantization.cpp
quantize_fp16.cpp
quantize_int8.cpp
reduce_dims.cpp
register_op.cpp
register_target.cpp
rewrite_batchnorm.cpp
rewrite_pooling.cpp
rewrite_quantization.cpp
rewrite_rnn.cpp
schedule.cpp
serialize.cpp
shape.cpp
simplify_algebra.cpp
simplify_qdq.cpp
simplify_reshapes.cpp
targets/ref/gemm.cpp
targets/ref/target.cpp
targets/ref/lowering.cpp
targets/gpu/logsoftmax.cpp
targets/gpu/write_literals.cpp
targets/gpu/schedule_model.cpp
targets/gpu/device_name.cpp
targets/gpu/compile_hip_code_object.cpp
targets/gpu/argmin.cpp
targets/gpu/convert.cpp
targets/gpu/argmax.cpp
targets/gpu/driver/main.cpp
targets/gpu/driver/action.cpp
targets/gpu/driver/parser.cpp
targets/gpu/driver/run_op.cpp
targets/gpu/driver/compile_pointwise.cpp
targets/gpu/driver/perf.cpp
targets/gpu/lrn.cpp
targets/gpu/convolution.cpp
targets/gpu/softmax.cpp
targets/gpu/abs.cpp
targets/gpu/rocblas.cpp
targets/gpu/reverse.cpp
targets/gpu/pooling.cpp
targets/gpu/elu.cpp
targets/gpu/rnn_variable_seq_lens.cpp
targets/gpu/compile_hip.cpp
targets/gpu/eliminate_workspace.cpp
targets/gpu/device/logsoftmax.cpp
targets/gpu/device/prefix_scan_sum.cpp
targets/gpu/device/argmin.cpp
targets/gpu/device/add_clip.cpp
targets/gpu/device/convert.cpp
targets/gpu/device/reduce_sum.cpp
targets/gpu/device/mul.cpp
targets/gpu/device/argmax.cpp
targets/gpu/device/softmax.cpp
targets/gpu/device/reverse.cpp
targets/gpu/device/rnn_variable_seq_lens.cpp
targets/gpu/device/reduce_prod.cpp
targets/gpu/device/logical_or.cpp
targets/gpu/device/mul_add.cpp
targets/gpu/device/add.cpp
targets/gpu/device/reduce_mean.cpp
targets/gpu/device/rsqrt.cpp
targets/gpu/device/multinomial.cpp
targets/gpu/device/sqrt.cpp
targets/gpu/device/gelu.cpp
targets/gpu/device/int8_gemm_pack.cpp
targets/gpu/device/cos.cpp
targets/gpu/device/erf.cpp
targets/gpu/device/ceil.cpp
targets/gpu/device/scatter.cpp
targets/gpu/device/contiguous.cpp
targets/gpu/device/sign.cpp
targets/gpu/device/nonzero.cpp
targets/gpu/device/recip.cpp
targets/gpu/device/max.cpp
targets/gpu/device/exp.cpp
targets/gpu/device/clip.cpp
targets/gpu/device/pow.cpp
targets/gpu/device/logical_and.cpp
targets/gpu/device/floor.cpp
targets/gpu/device/add_sigmoid.cpp
targets/gpu/device/gather.cpp
targets/gpu/device/asin.cpp
targets/gpu/device/acos.cpp
targets/gpu/device/acosh.cpp
targets/gpu/device/layernorm.cpp
targets/gpu/device/div.cpp
targets/gpu/device/sinh.cpp
targets/gpu/device/round.cpp
targets/gpu/device/less.cpp
targets/gpu/device/sub.cpp
targets/gpu/device/concat.cpp
targets/gpu/device/add_tanh.cpp
targets/gpu/device/equal.cpp
targets/gpu/device/reduce_max.cpp
targets/gpu/device/relu.cpp
targets/gpu/device/atanh.cpp
targets/gpu/device/mul_add_relu.cpp
targets/gpu/device/log.cpp
targets/gpu/device/atan.cpp
targets/gpu/device/prelu.cpp
targets/gpu/device/where.cpp
targets/gpu/device/tanh.cpp
targets/gpu/device/pad.cpp
targets/gpu/device/asinh.cpp
targets/gpu/device/reduce_min.cpp
targets/gpu/device/cosh.cpp
targets/gpu/device/add_relu.cpp
targets/gpu/device/sin.cpp
targets/gpu/device/topk.cpp
targets/gpu/device/min.cpp
targets/gpu/device/tan.cpp
targets/gpu/device/fill.cpp
targets/gpu/device/logical_xor.cpp
targets/gpu/device/greater.cpp
targets/gpu/device/sigmoid.cpp
targets/gpu/device/sqdiff.cpp
targets/gpu/device/unary_not.cpp
targets/gpu/quant_convolution.cpp
targets/gpu/hip.cpp
targets/gpu/multinomial.cpp
targets/gpu/compile_roialign.cpp
targets/gpu/int8_gemm_pack.cpp
targets/gpu/scatter.cpp
targets/gpu/nonzero.cpp
targets/gpu/clip.cpp
targets/gpu/mlir_conv.cpp
targets/gpu/gather.cpp
targets/gpu/batch_norm_inference.cpp
targets/gpu/allocation_model.cpp
targets/gpu/analyze_streams.cpp
targets/gpu/int8_conv_pack.cpp
targets/gpu/fuse_ops.cpp
targets/gpu/concat.cpp
targets/gpu/target.cpp
targets/gpu/lowering.cpp
targets/gpu/gemm_impl.cpp
targets/gpu/leaky_relu.cpp
targets/gpu/kernel.cpp
targets/gpu/pad.cpp
targets/gpu/compile_ops.cpp
targets/gpu/deconvolution.cpp
targets/gpu/compile_pointwise.cpp
targets/gpu/topk.cpp
targets/gpu/loop.cpp
targets/gpu/code_object_op.cpp
targets/gpu/pack_args.cpp
targets/gpu/sync_device.cpp
targets/gpu/pack_int8_args.cpp
targets/cpu/logsoftmax.cpp
targets/cpu/write_literals.cpp
targets/cpu/gemm.cpp
targets/cpu/lrn.cpp
targets/cpu/convolution.cpp
targets/cpu/softmax.cpp
targets/cpu/pooling.cpp
targets/cpu/reorder.cpp
targets/cpu/erf.cpp
targets/cpu/eltwise.cpp
targets/cpu/copy.cpp
targets/cpu/preallocate.cpp
targets/cpu/gather.cpp
targets/cpu/layernorm.cpp
targets/cpu/reduction.cpp
targets/cpu/allocation_model.cpp
targets/cpu/fuse_ops.cpp
targets/cpu/sub.cpp
targets/cpu/concat.cpp
targets/cpu/target.cpp
targets/cpu/lowering.cpp
targets/cpu/allocate.cpp
targets/cpu/deconvolution.cpp
targets/cpu/binary.cpp
targets/cpu/dnnl.cpp
tf/parse_squeeze.cpp
tf/parse_generic_op.cpp
tf/parse_matmul.cpp
tf/parse_depthwiseconv.cpp
tf/parse_reshape.cpp
tf/tf_parser.cpp
tf/tf.cpp
tf/parse_transpose.cpp
tf/parse_relu6.cpp
tf/parse_arg_op.cpp
tf/op_parser.cpp
tf/parse_softmax.cpp
tf/parse_concat.cpp
tf/parse_gather.cpp
tf/parse_slice.cpp
tf/parse_binary_op.cpp
tf/parse_onehot.cpp
tf/parse_split.cpp
tf/parse_shape.cpp
tf/parse_batchnorm.cpp
tf/parse_constant.cpp
tf/parse_pooling.cpp
tf/parse_cast.cpp
tf/parse_biasadd.cpp
tf/parse_pack.cpp
tf/parse_conv.cpp
tf/parse_stridedslice.cpp
tf/parse_pad.cpp
tf/parse_mean.cpp
tf/parse_expanddims.cpp
tmp_dir.cpp
value.cpp
verify_args.cpp
api/include/migraphx/migraphx.hpp
driver/marker_roctx.hpp
driver/command.hpp
driver/models.hpp
driver/argument_parser.hpp
driver/perf.hpp
driver/verify.hpp
driver/precision.hpp
include/migraphx/gemm.hpp
include/migraphx/eliminate_contiguous.hpp
include/migraphx/iterator.hpp
include/migraphx/argument.hpp
include/migraphx/fuse_pointwise.hpp
include/migraphx/eliminate_identity.hpp
include/migraphx/concat_opt.hpp
include/migraphx/make_op.hpp
include/migraphx/module.hpp
include/migraphx/type_traits.hpp
include/migraphx/eliminate_common_subexpression.hpp
include/migraphx/tensor_view.hpp
include/migraphx/pass_manager.hpp
include/migraphx/module_ref.hpp
include/migraphx/program.hpp
include/migraphx/float_equal.hpp
include/migraphx/tmp_dir.hpp
include/migraphx/tf.hpp
include/migraphx/make_shared_array.hpp
include/migraphx/raw_data.hpp
include/migraphx/memory_coloring.hpp
include/migraphx/filesystem.hpp
include/migraphx/eliminate_concat.hpp
include/migraphx/eliminate_pad.hpp
include/migraphx/normalize_attributes.hpp
include/migraphx/instruction.hpp
include/migraphx/dfor.hpp
include/migraphx/simplify_qdq.hpp
include/migraphx/value.hpp
include/migraphx/pass_config.hpp
include/migraphx/reflect.hpp
include/migraphx/adjust_allocation.hpp
include/migraphx/dom_info.hpp
include/migraphx/tune_axis.hpp
include/migraphx/int_divide.hpp
include/migraphx/par_dfor.hpp
include/migraphx/shape_for_each.hpp
include/migraphx/erase.hpp
include/migraphx/par_for.hpp
include/migraphx/stringutils.hpp
include/migraphx/errors.hpp
include/migraphx/dead_code_elimination.hpp
include/migraphx/cpp_generator.hpp
include/migraphx/register_target.hpp
include/migraphx/apply_alpha_beta.hpp
include/migraphx/insert_pad.hpp
include/migraphx/operators.hpp
include/migraphx/quantization.hpp
include/migraphx/env.hpp
include/migraphx/msgpack.hpp
include/migraphx/check_context.hpp
include/migraphx/tracer.hpp
include/migraphx/run_loop.hpp
include/migraphx/lifetime.hpp
include/migraphx/operation.hpp
include/migraphx/target.hpp
include/migraphx/marker.hpp
include/migraphx/convert_to_json.hpp
include/migraphx/stream_model.hpp
include/migraphx/output_iterator.hpp
include/migraphx/config.hpp
include/migraphx/onnx.hpp
include/migraphx/type_name.hpp
include/migraphx/fallthrough.hpp
include/migraphx/instruction_ref.hpp
include/migraphx/cloneable.hpp
include/migraphx/algorithm.hpp
include/migraphx/auto_register.hpp
include/migraphx/auto_any_cast.hpp
include/migraphx/serialize.hpp
include/migraphx/rewrite_rnn.hpp
include/migraphx/literal.hpp
include/migraphx/match/gelu_tanh.hpp
include/migraphx/match/gelu_erf.hpp
include/migraphx/match/layernorm.hpp
include/migraphx/manage_ptr.hpp
include/migraphx/check_shapes.hpp
include/migraphx/requires.hpp
include/migraphx/verify_args.hpp
include/migraphx/process.hpp
include/migraphx/schedule.hpp
include/migraphx/builtin.hpp
include/migraphx/propagate_constant.hpp
include/migraphx/rewrite_quantization.hpp
include/migraphx/make_signed.hpp
include/migraphx/compile_src.hpp
include/migraphx/dynamic_loader.hpp
include/migraphx/iota_iterator.hpp
include/migraphx/permutation.hpp
include/migraphx/half.hpp
include/migraphx/allocation_model.hpp
include/migraphx/quantize_fp16.hpp
include/migraphx/shape.hpp
include/migraphx/common.hpp
include/migraphx/compile_options.hpp
include/migraphx/register_op.hpp
include/migraphx/file_buffer.hpp
include/migraphx/verify.hpp
include/migraphx/normalize_ops.hpp
include/migraphx/analyze_streams.hpp
include/migraphx/rewrite_batchnorm.hpp
include/migraphx/rank.hpp
include/migraphx/preallocate_param.hpp
include/migraphx/streamutils.hpp
include/migraphx/op/max.hpp
include/migraphx/op/unary.hpp
include/migraphx/op/abs.hpp
include/migraphx/op/convolution.hpp
include/migraphx/op/multibroadcast.hpp
include/migraphx/op/binary.hpp
include/migraphx/op/nonzero.hpp
include/migraphx/op/cosh.hpp
include/migraphx/op/unary_not.hpp
include/migraphx/op/neg.hpp
include/migraphx/op/sign.hpp
include/migraphx/op/logical_and.hpp
include/migraphx/op/tan.hpp
include/migraphx/op/step.hpp
include/migraphx/op/gather.hpp
include/migraphx/op/acos.hpp
include/migraphx/op/im2col.hpp
include/migraphx/op/lstm.hpp
include/migraphx/op/sqrt.hpp
include/migraphx/op/prefix_scan_op.hpp
include/migraphx/op/where.hpp
include/migraphx/op/deconvolution.hpp
include/migraphx/op/sinh.hpp
include/migraphx/op/rnn_last_cell_output.hpp
include/migraphx/op/cos.hpp
include/migraphx/op/relu.hpp
include/migraphx/op/dot.hpp
include/migraphx/op/quant_dot.hpp
include/migraphx/op/round.hpp
include/migraphx/op/flatten.hpp
include/migraphx/op/sigmoid.hpp
include/migraphx/op/contiguous.hpp
include/migraphx/op/sqdiff.hpp
include/migraphx/op/quant_convolution.hpp
include/migraphx/op/elu.hpp
include/migraphx/op/pooling.hpp
include/migraphx/op/gru.hpp
include/migraphx/op/softmax.hpp
include/migraphx/op/add.hpp
include/migraphx/op/exp.hpp
include/migraphx/op/reduce_min.hpp
include/migraphx/op/reduce_mean.hpp
include/migraphx/op/logsoftmax.hpp
include/migraphx/op/sin.hpp
include/migraphx/op/name.hpp
include/migraphx/op/scatter.hpp
include/migraphx/op/pow.hpp
include/migraphx/op/multinomial.hpp
include/migraphx/op/unsqueeze.hpp
include/migraphx/op/leaky_relu.hpp
include/migraphx/op/argmax.hpp
include/migraphx/op/if_op.hpp
include/migraphx/op/unknown.hpp
include/migraphx/op/get_tuple_elem.hpp
include/migraphx/op/reshape.hpp
include/migraphx/op/batch_norm_inference.hpp
include/migraphx/op/lrn.hpp
include/migraphx/op/slice.hpp
include/migraphx/op/undefined.hpp
include/migraphx/op/mul.hpp
include/migraphx/op/pointwise.hpp
include/migraphx/op/loop.hpp
include/migraphx/op/less.hpp
include/migraphx/op/rnn_last_hs_output.hpp
include/migraphx/op/acosh.hpp
include/migraphx/op/squeeze.hpp
include/migraphx/op/nonmaxsuppression.hpp
include/migraphx/op/capture.hpp
include/migraphx/op/rnn_var_sl_last_output.hpp
include/migraphx/op/atan.hpp
include/migraphx/op/prelu.hpp
include/migraphx/op/div.hpp
include/migraphx/op/argmin.hpp
include/migraphx/op/as_shape.hpp
include/migraphx/op/topk.hpp
include/migraphx/op/dequantizelinear.hpp
include/migraphx/op/reduce_op.hpp
include/migraphx/op/normalize_attribute.hpp
include/migraphx/op/convert.hpp
include/migraphx/op/recip.hpp
include/migraphx/op/transpose.hpp
include/migraphx/op/logical_or.hpp
include/migraphx/op/log.hpp
include/migraphx/op/load.hpp
include/migraphx/op/tanh.hpp
include/migraphx/op/erf.hpp
include/migraphx/op/outline.hpp
include/migraphx/op/common.hpp
include/migraphx/op/reduce_prod.hpp
include/migraphx/op/logical_xor.hpp
include/migraphx/op/atanh.hpp
include/migraphx/op/rsqrt.hpp
include/migraphx/op/reverse.hpp
include/migraphx/op/rnn.hpp
include/migraphx/op/asinh.hpp
include/migraphx/op/floor.hpp
include/migraphx/op/rnn_variable_seq_lens.hpp
include/migraphx/op/broadcast.hpp
include/migraphx/op/asin.hpp
include/migraphx/op/min.hpp
include/migraphx/op/sub.hpp
include/migraphx/op/pad.hpp
include/migraphx/op/reduce_max.hpp
include/migraphx/op/roialign.hpp
include/migraphx/op/ceil.hpp
include/migraphx/op/scalar.hpp
include/migraphx/op/reduce_sum.hpp
include/migraphx/op/quantizelinear.hpp
include/migraphx/op/equal.hpp
include/migraphx/op/identity.hpp
include/migraphx/op/concat.hpp
include/migraphx/op/greater.hpp
include/migraphx/op/clip.hpp
include/migraphx/op/prefix_scan_sum.hpp
include/migraphx/array.hpp
include/migraphx/json.hpp
include/migraphx/pad_calc.hpp
include/migraphx/assert.hpp
include/migraphx/rewrite_pooling.hpp
include/migraphx/optional.hpp
include/migraphx/auto_contiguous.hpp
include/migraphx/generate.hpp
include/migraphx/ranges.hpp
include/migraphx/eliminate_allocation.hpp
include/migraphx/functional.hpp
include/migraphx/schedule_model.hpp
include/migraphx/inline_module.hpp
include/migraphx/time.hpp
include/migraphx/eliminate_data_type.hpp
include/migraphx/simplify_reshapes.hpp
include/migraphx/quantize_int8.hpp
include/migraphx/reduce_dims.hpp
include/migraphx/clamp.hpp
include/migraphx/load_save.hpp
include/migraphx/simplify_algebra.hpp
include/migraphx/iterator_for.hpp
include/migraphx/context.hpp
include/migraphx/matcher.hpp
include/migraphx/pass.hpp
onnx/include/migraphx/onnx/op_parser.hpp
onnx/include/migraphx/onnx/map_activation_functions.hpp
onnx/include/migraphx/onnx/checks.hpp
onnx/include/migraphx/onnx/onnx_parser.hpp
onnx/include/migraphx/onnx/padding.hpp
onnx/include/migraphx/onnx/conv.hpp
opt/memory_coloring_impl.hpp
targets/ref/include/migraphx/ref/gemm.hpp
targets/ref/include/migraphx/ref/target.hpp
targets/ref/include/migraphx/ref/lowering.hpp
targets/ref/include/migraphx/ref/context.hpp
targets/gpu/driver/include/migraphx/gpu/driver/parser.hpp
targets/gpu/driver/include/migraphx/gpu/driver/perf.hpp
targets/gpu/driver/include/migraphx/gpu/driver/action.hpp
targets/gpu/kernels/include/migraphx/kernels/hip.hpp
targets/gpu/kernels/include/migraphx/kernels/type_traits.hpp
targets/gpu/kernels/include/migraphx/kernels/generic_constant.hpp
targets/gpu/kernels/include/migraphx/kernels/basic_ops.hpp
targets/gpu/kernels/include/migraphx/kernels/tensor_view.hpp
targets/gpu/kernels/include/migraphx/kernels/vec.hpp
targets/gpu/kernels/include/migraphx/kernels/dfor.hpp
targets/gpu/kernels/include/migraphx/kernels/print.hpp
targets/gpu/kernels/include/migraphx/kernels/pointwise.hpp
targets/gpu/kernels/include/migraphx/kernels/preload.hpp
targets/gpu/kernels/include/migraphx/kernels/types.hpp
targets/gpu/kernels/include/migraphx/kernels/algorithm.hpp
targets/gpu/kernels/include/migraphx/kernels/math.hpp
targets/gpu/kernels/include/migraphx/kernels/shape.hpp
targets/gpu/kernels/include/migraphx/kernels/debug.hpp
targets/gpu/kernels/include/migraphx/kernels/array.hpp
targets/gpu/kernels/include/migraphx/kernels/integral_constant.hpp
targets/gpu/kernels/include/migraphx/kernels/functional.hpp
targets/gpu/kernels/include/migraphx/kernels/roialign.hpp
targets/gpu/kernels/include/migraphx/kernels/vectorize.hpp
targets/gpu/kernels/include/migraphx/kernels/args.hpp
targets/gpu/kernels/include/migraphx/kernels/index.hpp
targets/gpu/device/include/migraphx/gpu/device/multi_index.hpp
targets/gpu/device/include/migraphx/gpu/device/nary.hpp
targets/gpu/device/include/migraphx/gpu/device/tensor_view.hpp
targets/gpu/device/include/migraphx/gpu/device/float_equal.hpp
targets/gpu/device/include/migraphx/gpu/device/scan.hpp
targets/gpu/device/include/migraphx/gpu/device/vector.hpp
targets/gpu/device/include/migraphx/gpu/device/types.hpp
targets/gpu/device/include/migraphx/gpu/device/fast_div.hpp
targets/gpu/device/include/migraphx/gpu/device/reduce.hpp
targets/gpu/device/include/migraphx/gpu/device/tensor.hpp
targets/gpu/device/include/migraphx/gpu/device/shape.hpp
targets/gpu/device/include/migraphx/gpu/device/launch.hpp
targets/gpu/device/include/migraphx/gpu/device/reduce_ops.hpp
targets/gpu/device/include/migraphx/gpu/device/array.hpp
targets/gpu/device/include/migraphx/gpu/device/visit.hpp
targets/gpu/include/migraphx/gpu/max.hpp
targets/gpu/include/migraphx/gpu/gemm.hpp
targets/gpu/include/migraphx/gpu/write_literals.hpp
targets/gpu/include/migraphx/gpu/abs.hpp
targets/gpu/include/migraphx/gpu/convolution.hpp
targets/gpu/include/migraphx/gpu/nonzero.hpp
targets/gpu/include/migraphx/gpu/cosh.hpp
targets/gpu/include/migraphx/gpu/hip.hpp
targets/gpu/include/migraphx/gpu/unary_not.hpp
targets/gpu/include/migraphx/gpu/sign.hpp
targets/gpu/include/migraphx/gpu/logical_and.hpp
targets/gpu/include/migraphx/gpu/tan.hpp
targets/gpu/include/migraphx/gpu/gather.hpp
targets/gpu/include/migraphx/gpu/acos.hpp
targets/gpu/include/migraphx/gpu/pack_int8_args.hpp
targets/gpu/include/migraphx/gpu/sqrt.hpp
targets/gpu/include/migraphx/gpu/where.hpp
targets/gpu/include/migraphx/gpu/deconvolution.hpp
targets/gpu/include/migraphx/gpu/compile_pointwise.hpp
targets/gpu/include/migraphx/gpu/fuse_ops.hpp
targets/gpu/include/migraphx/gpu/sinh.hpp
targets/gpu/include/migraphx/gpu/cos.hpp
targets/gpu/include/migraphx/gpu/relu.hpp
targets/gpu/include/migraphx/gpu/compile_hip_code_object.hpp
targets/gpu/include/migraphx/gpu/round.hpp
targets/gpu/include/migraphx/gpu/sigmoid.hpp
targets/gpu/include/migraphx/gpu/contiguous.hpp
targets/gpu/include/migraphx/gpu/int8_conv_pack.hpp
targets/gpu/include/migraphx/gpu/sqdiff.hpp
targets/gpu/include/migraphx/gpu/quant_convolution.hpp
targets/gpu/include/migraphx/gpu/elu.hpp
targets/gpu/include/migraphx/gpu/pooling.hpp
targets/gpu/include/migraphx/gpu/softmax.hpp
targets/gpu/include/migraphx/gpu/add.hpp
targets/gpu/include/migraphx/gpu/device/max.hpp
targets/gpu/include/migraphx/gpu/device/nonzero.hpp
targets/gpu/include/migraphx/gpu/device/cosh.hpp
targets/gpu/include/migraphx/gpu/device/add_relu.hpp
targets/gpu/include/migraphx/gpu/device/add_clip.hpp
targets/gpu/include/migraphx/gpu/device/unary_not.hpp
targets/gpu/include/migraphx/gpu/device/sign.hpp
targets/gpu/include/migraphx/gpu/device/logical_and.hpp
targets/gpu/include/migraphx/gpu/device/tan.hpp
targets/gpu/include/migraphx/gpu/device/gather.hpp
targets/gpu/include/migraphx/gpu/device/acos.hpp
targets/gpu/include/migraphx/gpu/device/add_tanh.hpp
targets/gpu/include/migraphx/gpu/device/gelu.hpp
targets/gpu/include/migraphx/gpu/device/sqrt.hpp
targets/gpu/include/migraphx/gpu/device/where.hpp
targets/gpu/include/migraphx/gpu/device/sinh.hpp
targets/gpu/include/migraphx/gpu/device/cos.hpp
targets/gpu/include/migraphx/gpu/device/relu.hpp
targets/gpu/include/migraphx/gpu/device/round.hpp
targets/gpu/include/migraphx/gpu/device/sigmoid.hpp
targets/gpu/include/migraphx/gpu/device/contiguous.hpp
targets/gpu/include/migraphx/gpu/device/sqdiff.hpp
targets/gpu/include/migraphx/gpu/device/softmax.hpp
targets/gpu/include/migraphx/gpu/device/add.hpp
targets/gpu/include/migraphx/gpu/device/exp.hpp
targets/gpu/include/migraphx/gpu/device/reduce_min.hpp
targets/gpu/include/migraphx/gpu/device/add_sigmoid.hpp
targets/gpu/include/migraphx/gpu/device/reduce_mean.hpp
targets/gpu/include/migraphx/gpu/device/logsoftmax.hpp
targets/gpu/include/migraphx/gpu/device/sin.hpp
targets/gpu/include/migraphx/gpu/device/fill.hpp
targets/gpu/include/migraphx/gpu/device/scatter.hpp
targets/gpu/include/migraphx/gpu/device/pow.hpp
targets/gpu/include/migraphx/gpu/device/multinomial.hpp
targets/gpu/include/migraphx/gpu/device/argmax.hpp
targets/gpu/include/migraphx/gpu/device/arg_op.hpp
targets/gpu/include/migraphx/gpu/device/mul.hpp
targets/gpu/include/migraphx/gpu/device/less.hpp
targets/gpu/include/migraphx/gpu/device/acosh.hpp
targets/gpu/include/migraphx/gpu/device/atan.hpp
targets/gpu/include/migraphx/gpu/device/prelu.hpp
targets/gpu/include/migraphx/gpu/device/div.hpp
targets/gpu/include/migraphx/gpu/device/argmin.hpp
targets/gpu/include/migraphx/gpu/device/topk.hpp
targets/gpu/include/migraphx/gpu/device/convert.hpp
targets/gpu/include/migraphx/gpu/device/int8_gemm_pack.hpp
targets/gpu/include/migraphx/gpu/device/recip.hpp
targets/gpu/include/migraphx/gpu/device/logical_or.hpp
targets/gpu/include/migraphx/gpu/device/log.hpp
targets/gpu/include/migraphx/gpu/device/tanh.hpp
targets/gpu/include/migraphx/gpu/device/mul_add.hpp
targets/gpu/include/migraphx/gpu/device/erf.hpp
targets/gpu/include/migraphx/gpu/device/mul_add_relu.hpp
targets/gpu/include/migraphx/gpu/device/layernorm.hpp
targets/gpu/include/migraphx/gpu/device/reduce_prod.hpp
targets/gpu/include/migraphx/gpu/device/logical_xor.hpp
targets/gpu/include/migraphx/gpu/device/atanh.hpp
targets/gpu/include/migraphx/gpu/device/rsqrt.hpp
targets/gpu/include/migraphx/gpu/device/reverse.hpp
targets/gpu/include/migraphx/gpu/device/asinh.hpp
targets/gpu/include/migraphx/gpu/device/floor.hpp
targets/gpu/include/migraphx/gpu/device/rnn_variable_seq_lens.hpp
targets/gpu/include/migraphx/gpu/device/asin.hpp
targets/gpu/include/migraphx/gpu/device/min.hpp
targets/gpu/include/migraphx/gpu/device/sub.hpp
targets/gpu/include/migraphx/gpu/device/pad.hpp
targets/gpu/include/migraphx/gpu/device/reduce_max.hpp
targets/gpu/include/migraphx/gpu/device/ceil.hpp
targets/gpu/include/migraphx/gpu/device/reduce_sum.hpp
targets/gpu/include/migraphx/gpu/device/equal.hpp
targets/gpu/include/migraphx/gpu/device/concat.hpp
targets/gpu/include/migraphx/gpu/device/greater.hpp
targets/gpu/include/migraphx/gpu/device/clip.hpp
targets/gpu/include/migraphx/gpu/device/prefix_scan_sum.hpp
targets/gpu/include/migraphx/gpu/mlir_conv.hpp
targets/gpu/include/migraphx/gpu/exp.hpp
targets/gpu/include/migraphx/gpu/reduce_min.hpp
targets/gpu/include/migraphx/gpu/reduce_mean.hpp
targets/gpu/include/migraphx/gpu/logsoftmax.hpp
targets/gpu/include/migraphx/gpu/sin.hpp
targets/gpu/include/migraphx/gpu/name.hpp
targets/gpu/include/migraphx/gpu/scatter.hpp
targets/gpu/include/migraphx/gpu/pow.hpp
targets/gpu/include/migraphx/gpu/multinomial.hpp
targets/gpu/include/migraphx/gpu/leaky_relu.hpp
targets/gpu/include/migraphx/gpu/argmax.hpp
targets/gpu/include/migraphx/gpu/target.hpp
targets/gpu/include/migraphx/gpu/batch_norm_inference.hpp
targets/gpu/include/migraphx/gpu/lrn.hpp
targets/gpu/include/migraphx/gpu/miopen.hpp
targets/gpu/include/migraphx/gpu/mul.hpp
targets/gpu/include/migraphx/gpu/loop.hpp
targets/gpu/include/migraphx/gpu/less.hpp
targets/gpu/include/migraphx/gpu/acosh.hpp
targets/gpu/include/migraphx/gpu/atan.hpp
targets/gpu/include/migraphx/gpu/prelu.hpp
targets/gpu/include/migraphx/gpu/div.hpp
targets/gpu/include/migraphx/gpu/sync_device.hpp
targets/gpu/include/migraphx/gpu/argmin.hpp
targets/gpu/include/migraphx/gpu/gemm_impl.hpp
targets/gpu/include/migraphx/gpu/topk.hpp
targets/gpu/include/migraphx/gpu/reduce_op.hpp
targets/gpu/include/migraphx/gpu/convert.hpp
targets/gpu/include/migraphx/gpu/oper.hpp
targets/gpu/include/migraphx/gpu/int8_gemm_pack.hpp
targets/gpu/include/migraphx/gpu/lowering.hpp
targets/gpu/include/migraphx/gpu/recip.hpp
targets/gpu/include/migraphx/gpu/concat_gpu_opt.hpp
targets/gpu/include/migraphx/gpu/logical_or.hpp
targets/gpu/include/migraphx/gpu/log.hpp
targets/gpu/include/migraphx/gpu/tanh.hpp
targets/gpu/include/migraphx/gpu/erf.hpp
targets/gpu/include/migraphx/gpu/pack_args.hpp
targets/gpu/include/migraphx/gpu/rocblas.hpp
targets/gpu/include/migraphx/gpu/allocation_model.hpp
targets/gpu/include/migraphx/gpu/device_name.hpp
targets/gpu/include/migraphx/gpu/compile_hip.hpp
targets/gpu/include/migraphx/gpu/reduce_prod.hpp
targets/gpu/include/migraphx/gpu/logical_xor.hpp
targets/gpu/include/migraphx/gpu/atanh.hpp
targets/gpu/include/migraphx/gpu/rsqrt.hpp
targets/gpu/include/migraphx/gpu/analyze_streams.hpp
targets/gpu/include/migraphx/gpu/reverse.hpp
targets/gpu/include/migraphx/gpu/compile_ops.hpp
targets/gpu/include/migraphx/gpu/compile_roialign.hpp
targets/gpu/include/migraphx/gpu/code_object_op.hpp
targets/gpu/include/migraphx/gpu/kernel.hpp
targets/gpu/include/migraphx/gpu/asinh.hpp
targets/gpu/include/migraphx/gpu/floor.hpp
targets/gpu/include/migraphx/gpu/rnn_variable_seq_lens.hpp
targets/gpu/include/migraphx/gpu/schedule_model.hpp
targets/gpu/include/migraphx/gpu/asin.hpp
targets/gpu/include/migraphx/gpu/min.hpp
targets/gpu/include/migraphx/gpu/sub.hpp
targets/gpu/include/migraphx/gpu/pad.hpp
targets/gpu/include/migraphx/gpu/reduce_max.hpp
targets/gpu/include/migraphx/gpu/ceil.hpp
targets/gpu/include/migraphx/gpu/eliminate_workspace.hpp
targets/gpu/include/migraphx/gpu/reduce_sum.hpp
targets/gpu/include/migraphx/gpu/equal.hpp
targets/gpu/include/migraphx/gpu/concat.hpp
targets/gpu/include/migraphx/gpu/greater.hpp
targets/gpu/include/migraphx/gpu/clip.hpp
targets/gpu/include/migraphx/gpu/prefix_scan_sum.hpp
targets/gpu/include/migraphx/gpu/context.hpp
targets/cpu/include/migraphx/cpu/write_literals.hpp
targets/cpu/include/migraphx/cpu/dnnl.hpp
targets/cpu/include/migraphx/cpu/fuse_ops.hpp
targets/cpu/include/migraphx/cpu/target.hpp
targets/cpu/include/migraphx/cpu/pointwise.hpp
targets/cpu/include/migraphx/cpu/parallel.hpp
targets/cpu/include/migraphx/cpu/lowering.hpp
targets/cpu/include/migraphx/cpu/allocation_model.hpp
targets/cpu/include/migraphx/cpu/context.hpp
tf/include/migraphx/tf/op_parser.hpp
tf/include/migraphx/tf/tf_parser.hpp
src/fuse_pointwise.cpp
View file @
94e3a2e4
...
@@ -28,7 +28,7 @@ static literal get_scalar(instruction_ref ins)
...
@@ -28,7 +28,7 @@ static literal get_scalar(instruction_ref ins)
static
void
create_pointwise_modules
(
module_pass_manager
&
mpm
)
static
void
create_pointwise_modules
(
module_pass_manager
&
mpm
)
{
{
std
::
size_
t
n
=
0
;
in
t
n
=
0
;
for
(
auto
ins
:
iterator_for
(
mpm
.
get_module
()))
for
(
auto
ins
:
iterator_for
(
mpm
.
get_module
()))
{
{
if
(
not
ins
->
get_operator
().
attributes
().
get
(
"pointwise"
,
false
))
if
(
not
ins
->
get_operator
().
attributes
().
get
(
"pointwise"
,
false
))
...
@@ -39,7 +39,7 @@ static void create_pointwise_modules(module_pass_manager& mpm)
...
@@ -39,7 +39,7 @@ static void create_pointwise_modules(module_pass_manager& mpm)
std
::
unordered_map
<
instruction_ref
,
instruction_ref
>
param_map
;
std
::
unordered_map
<
instruction_ref
,
instruction_ref
>
param_map
;
std
::
vector
<
instruction_ref
>
pointwise_inputs
;
std
::
vector
<
instruction_ref
>
pointwise_inputs
;
std
::
size_
t
i
=
0
;
in
t
i
=
0
;
for
(
auto
input
:
ins
->
inputs
())
for
(
auto
input
:
ins
->
inputs
())
{
{
if
(
contains
(
param_map
,
input
))
if
(
contains
(
param_map
,
input
))
...
...
Prev
1
2
3
4
5
…
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