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
ff3bd8e6
Commit
ff3bd8e6
authored
May 12, 2021
by
Khalique Ahmed
Browse files
manual merge
parents
32b69ceb
c310bc5c
Changes
83
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
tools/api/api.cpp
tools/api/api.cpp
+2
-0
tools/api/migraphx.h
tools/api/migraphx.h
+1
-0
tools/include/pass.hpp
tools/include/pass.hpp
+6
-3
No files found.
tools/api/api.cpp
View file @
ff3bd8e6
...
@@ -49,6 +49,7 @@ shape::type_t to_shape_type(migraphx_shape_datatype_t t)
...
@@ -49,6 +49,7 @@ shape::type_t to_shape_type(migraphx_shape_datatype_t t)
{
{
switch
(
t
)
switch
(
t
)
{
{
case
migraphx_shape_tuple_type
:
return
shape
::
tuple_type
;
#define MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT(x, y) \
#define MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT(x, y) \
case migraphx_shape_##x: return shape::x;
case migraphx_shape_##x: return shape::x;
MIGRAPHX_SHAPE_VISIT_TYPES
(
MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT
)
MIGRAPHX_SHAPE_VISIT_TYPES
(
MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT
)
...
@@ -61,6 +62,7 @@ migraphx_shape_datatype_t to_shape_type(shape::type_t t)
...
@@ -61,6 +62,7 @@ migraphx_shape_datatype_t to_shape_type(shape::type_t t)
{
{
switch
(
t
)
switch
(
t
)
{
{
case
shape
::
tuple_type
:
return
migraphx_shape_tuple_type
;
#define MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT(x, y) \
#define MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT(x, y) \
case shape::x: return migraphx_shape_##x;
case shape::x: return migraphx_shape_##x;
MIGRAPHX_SHAPE_VISIT_TYPES
(
MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT
)
MIGRAPHX_SHAPE_VISIT_TYPES
(
MIGRAPHX_DETAIL_SHAPE_CASE_CONVERT
)
...
...
tools/api/migraphx.h
View file @
ff3bd8e6
...
@@ -36,6 +36,7 @@ typedef enum {
...
@@ -36,6 +36,7 @@ typedef enum {
#define MIGRAPHX_SHAPE_GENERATE_ENUM_TYPES(x, t) migraphx_shape_##x,
#define MIGRAPHX_SHAPE_GENERATE_ENUM_TYPES(x, t) migraphx_shape_##x,
/// An enum to represent the different data type inputs
/// An enum to represent the different data type inputs
typedef
enum
{
typedef
enum
{
migraphx_shape_tuple_type
,
MIGRAPHX_SHAPE_VISIT_TYPES
(
MIGRAPHX_SHAPE_GENERATE_ENUM_TYPES
)
MIGRAPHX_SHAPE_VISIT_TYPES
(
MIGRAPHX_SHAPE_GENERATE_ENUM_TYPES
)
}
migraphx_shape_datatype_t
;
}
migraphx_shape_datatype_t
;
#undef MIGRAPHX_SHAPE_GENERATE_ENUM_TYPES
#undef MIGRAPHX_SHAPE_GENERATE_ENUM_TYPES
...
...
tools/include/pass.hpp
View file @
ff3bd8e6
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
#include <cassert>
#include <cassert>
#include <string>
#include <string>
#include <functional>
#include <memory>
#include <memory>
#include <type_traits>
#include <type_traits>
#include <utility>
#include <utility>
#include <migraphx/functional.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
...
@@ -23,8 +23,10 @@ struct pass
...
@@ -23,8 +23,10 @@ struct pass
{
{
/// A unique name used to identify the pass
/// A unique name used to identify the pass
std
::
string
name
()
const
;
std
::
string
name
()
const
;
/// Run the pass on the module
void
apply
(
module
&
m
)
const
;
/// Run the pass on the program
/// Run the pass on the program
void
apply
(
module
&
p
)
const
;
void
apply
(
program
&
p
)
const
;
};
};
#else
#else
...
@@ -32,7 +34,8 @@ struct pass
...
@@ -32,7 +34,8 @@ struct pass
<%
<%
interface
(
'
pass
'
,
interface
(
'
pass
'
,
virtual
(
'
name
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
name
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
apply
'
,
returns
=
'
void
'
,
p
=
'
module
&
'
,
const
=
True
)
virtual
(
'
apply
'
,
returns
=
'
void
'
,
m
=
'
module
&
'
,
const
=
True
,
default
=
'
migraphx
::
nop
'
),
virtual
(
'
apply
'
,
returns
=
'
void
'
,
p
=
'
program
&
'
,
const
=
True
,
default
=
'
migraphx
::
nop
'
)
)
)
%>
%>
...
...
Prev
1
2
3
4
5
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