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
08c3377f
Commit
08c3377f
authored
Aug 10, 2023
by
umangyadav
Browse files
Fix assert
parent
3265b9f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
src/serialize.cpp
src/serialize.cpp
+1
-1
test/serialize_program.cpp
test/serialize_program.cpp
+2
-1
No files found.
src/serialize.cpp
View file @
08c3377f
...
@@ -77,7 +77,7 @@ void migraphx_from_value(const value& v, literal& l)
...
@@ -77,7 +77,7 @@ void migraphx_from_value(const value& v, literal& l)
auto
v_data
=
v
.
at
(
"data"
);
auto
v_data
=
v
.
at
(
"data"
);
assert
(
v_data
.
is_array
());
assert
(
v_data
.
is_array
());
size_t
array_size
=
1
+
((
binary_size
-
1
)
/
partition_length
);
size_t
array_size
=
1
+
((
binary_size
-
1
)
/
partition_length
);
assert
(
array_size
==
v
.
size
());
assert
(
array_size
==
v
_data
.
size
());
std
::
vector
<
uint8_t
>
binary_array
(
binary_size
);
std
::
vector
<
uint8_t
>
binary_array
(
binary_size
);
size_t
read_size
=
0
;
size_t
read_size
=
0
;
for
(
size_t
i
=
0
;
i
<
array_size
;
++
i
)
for
(
size_t
i
=
0
;
i
<
array_size
;
++
i
)
...
...
test/serialize_program.cpp
View file @
08c3377f
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
#include <migraphx/register_target.hpp>
#include <migraphx/register_target.hpp>
#include <migraphx/load_save.hpp>
#include <migraphx/load_save.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/generate.hpp>
#include "test.hpp"
#include <migraphx/make_op.hpp>
#include <migraphx/make_op.hpp>
#include "test.hpp"
#include <cstdio>
#include <cstdio>
...
@@ -93,6 +93,7 @@ TEST_CASE(large_literal)
...
@@ -93,6 +93,7 @@ TEST_CASE(large_literal)
{
{
migraphx
::
program
p1
;
migraphx
::
program
p1
;
auto
*
mm
=
p1
.
get_main_module
();
auto
*
mm
=
p1
.
get_main_module
();
// literal with ~~5GB size
mm
->
add_literal
(
migraphx
::
generate_literal
({
migraphx
::
shape
::
half_type
,
{
39664984
,
64
}}));
mm
->
add_literal
(
migraphx
::
generate_literal
({
migraphx
::
shape
::
half_type
,
{
39664984
,
64
}}));
std
::
vector
<
char
>
buffer
=
migraphx
::
save_buffer
(
p1
);
std
::
vector
<
char
>
buffer
=
migraphx
::
save_buffer
(
p1
);
migraphx
::
program
p2
=
migraphx
::
load_buffer
(
buffer
);
migraphx
::
program
p2
=
migraphx
::
load_buffer
(
buffer
);
...
...
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