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
6556b163
".github/vscode:/vscode.git/clone" did not exist on "35aab2fbd9c8a1da8995b7a991c664e60d61e5ae"
Commit
6556b163
authored
Aug 10, 2023
by
umangyadav
Browse files
use throw
parent
15a0e142
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/serialize.cpp
src/serialize.cpp
+8
-3
No files found.
src/serialize.cpp
View file @
6556b163
...
...
@@ -75,9 +75,11 @@ void migraphx_from_value(const value& v, literal& l)
else
{
auto
v_data
=
v
.
at
(
"data"
);
assert
(
v_data
.
is_array
());
if
(
not
v_data
.
is_array
())
{
MIGRAPHX_THROW
(
"Literal is larger than 4GB but it is not stored as binary array"
);
}
size_t
array_size
=
1
+
((
binary_size
-
1
)
/
partition_length
);
assert
(
array_size
==
v_data
.
size
());
std
::
vector
<
uint8_t
>
binary_array
(
binary_size
);
size_t
read_size
=
0
;
for
(
size_t
i
=
0
;
i
<
array_size
;
++
i
)
...
...
@@ -88,7 +90,10 @@ void migraphx_from_value(const value& v, literal& l)
v_data
.
at
(
i
).
get_binary
().
size
());
read_size
+=
v_data
.
at
(
i
).
get_binary
().
size
();
}
assert
(
read_size
==
binary_size
);
if
(
read_size
!=
binary_size
or
array_size
!=
v_data
.
size
())
{
MIGRAPHX_THROW
(
"Literal deserialization failed. File is corrupted"
);
};
l
=
literal
(
s
,
binary_array
.
data
());
}
}
...
...
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