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
0714d98e
Commit
0714d98e
authored
Feb 12, 2022
by
Shucai Xiao
Browse files
fix build errors related to migraphx.hpp
parent
3272b22e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
27 deletions
+27
-27
src/api/api.cpp
src/api/api.cpp
+10
-10
src/api/include/migraphx/migraphx.h
src/api/include/migraphx/migraphx.h
+7
-7
src/api/include/migraphx/migraphx.hpp
src/api/include/migraphx/migraphx.hpp
+10
-10
No files found.
src/api/api.cpp
View file @
0714d98e
...
...
@@ -385,25 +385,25 @@ extern "C" migraphx_status migraphx_shape_destroy(migraphx_shape_t shape)
extern
"C"
migraphx_status
migraphx_shape_create
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
size_
t
*
lengths
,
in
t
lengths_size
)
in
t
*
lengths
,
size_
t
lengths_size
)
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
lengths
==
nullptr
and
lengths_size
!=
0
)
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter lengths: Null pointer"
);
*
shape
=
object_cast
<
migraphx_shape_t
>
(
allocate
<
migraphx
::
shape
>
((
migraphx
::
to_shape_type
(
type
)),
(
std
::
vector
<
size_
t
>
(
lengths
,
lengths
+
lengths_size
))));
(
std
::
vector
<
in
t
>
(
lengths
,
lengths
+
lengths_size
))));
});
return
api_error_result
;
}
extern
"C"
migraphx_status
migraphx_shape_create_with_strides
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
size_
t
*
lengths
,
in
t
lengths_size
,
size_
t
*
strides
,
in
t
strides_size
)
in
t
*
lengths
,
size_
t
lengths_size
,
in
t
*
strides
,
size_
t
strides_size
)
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
lengths
==
nullptr
and
lengths_size
!=
0
)
...
...
@@ -412,8 +412,8 @@ extern "C" migraphx_status migraphx_shape_create_with_strides(migraphx_shape_t*
MIGRAPHX_THROW
(
migraphx_status_bad_param
,
"Bad parameter strides: Null pointer"
);
*
shape
=
object_cast
<
migraphx_shape_t
>
(
allocate
<
migraphx
::
shape
>
((
migraphx
::
to_shape_type
(
type
)),
(
std
::
vector
<
size_
t
>
(
lengths
,
lengths
+
lengths_size
)),
(
std
::
vector
<
size_
t
>
(
strides
,
strides
+
strides_size
))));
(
std
::
vector
<
in
t
>
(
lengths
,
lengths
+
lengths_size
)),
(
std
::
vector
<
in
t
>
(
strides
,
strides
+
strides_size
))));
});
return
api_error_result
;
}
...
...
@@ -899,7 +899,7 @@ extern "C" migraphx_status migraphx_onnx_options_create(migraphx_onnx_options_t*
}
extern
"C"
migraphx_status
migraphx_onnx_options_set_input_parameter_shape
(
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
size_
t
*
dims
,
in
t
dims_size
)
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
in
t
*
dims
,
size_
t
dims_size
)
{
auto
api_error_result
=
migraphx
::
try_
([
&
]
{
if
(
onnx_options
==
nullptr
)
...
...
src/api/include/migraphx/migraphx.h
View file @
0714d98e
...
...
@@ -93,15 +93,15 @@ migraphx_status migraphx_shape_destroy(migraphx_shape_t shape);
migraphx_status
migraphx_shape_create
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
size_
t
*
lengths
,
in
t
lengths_size
);
in
t
*
lengths
,
size_
t
lengths_size
);
migraphx_status
migraphx_shape_create_with_strides
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
,
size_
t
*
lengths
,
in
t
lengths_size
,
size_
t
*
strides
,
in
t
strides_size
);
in
t
*
lengths
,
size_
t
lengths_size
,
in
t
*
strides
,
size_
t
strides_size
);
migraphx_status
migraphx_shape_create_scalar
(
migraphx_shape_t
*
shape
,
migraphx_shape_datatype_t
type
);
...
...
@@ -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_set_input_parameter_shape
(
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
size_
t
*
dims
,
in
t
dims_size
);
migraphx_onnx_options_t
onnx_options
,
const
char
*
name
,
in
t
*
dims
,
size_
t
dims_size
);
migraphx_status
migraphx_onnx_options_set_default_dim_value
(
migraphx_onnx_options_t
onnx_options
,
size_t
value
);
...
...
src/api/include/migraphx/migraphx.hpp
View file @
0714d98e
...
...
@@ -240,9 +240,9 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
this
->
make_handle
(
&
migraphx_shape_create_with_strides
,
type
,
plengths
.
data
(),
plengths
.
size
(),
static_cast
<
int
>
(
plengths
.
size
()
)
,
pstrides
.
data
(),
pstrides
.
size
());
static_cast
<
int
>
(
pstrides
.
size
())
)
;
}
std
::
vector
<
int
>
lengths
()
const
...
...
@@ -268,9 +268,9 @@ struct shape : MIGRAPHX_CONST_HANDLE_BASE(shape)
return
pout
;
}
in
t
bytes
()
const
size_
t
bytes
()
const
{
in
t
pout
;
size_
t
pout
;
call
(
&
migraphx_shape_bytes
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
}
...
...
@@ -364,9 +364,9 @@ struct program_parameter_shapes : MIGRAPHX_HANDLE_BASE(program_parameter_shapes)
this
->
set_handle
(
p
,
borrow
{});
}
in
t
size
()
const
size_
t
size
()
const
{
in
t
pout
;
size_
t
pout
;
call
(
&
migraphx_program_parameter_shapes_size
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
}
...
...
@@ -424,9 +424,9 @@ struct arguments : MIGRAPHX_HANDLE_BASE(arguments), array_base<arguments>
arguments
(
migraphx_arguments
*
p
,
borrow
)
{
this
->
set_handle
(
p
,
borrow
{});
}
in
t
size
()
const
size_
t
size
()
const
{
in
t
pout
;
size_
t
pout
;
call
(
&
migraphx_arguments_size
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
}
...
...
@@ -457,9 +457,9 @@ struct shapes : MIGRAPHX_HANDLE_BASE(shapes), array_base<shapes>
shapes
(
migraphx_shapes
*
p
,
borrow
)
{
this
->
set_handle
(
p
,
borrow
{});
}
in
t
size
()
const
size_
t
size
()
const
{
in
t
pout
;
size_
t
pout
;
call
(
&
migraphx_shapes_size
,
&
pout
,
this
->
get_handle_ptr
());
return
pout
;
}
...
...
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