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
661a6bbc
Commit
661a6bbc
authored
Aug 10, 2023
by
Paul
Browse files
Some fixes for the unit tests
parent
9564b809
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
test/msgpack.cpp
test/msgpack.cpp
+18
-1
No files found.
test/msgpack.cpp
View file @
661a6bbc
...
...
@@ -27,11 +27,28 @@
#include <map>
#include "test.hpp"
template
<
class
T
>
auto
msgpack_type
(
migraphx
::
rank
<
0
>
,
T
src
)
{
if
constexpr
(
std
::
is_class
<
T
>
{})
return
std
::
vector
<
T
>
{
src
};
else
return
src
;
}
template
<
class
T
>
auto
msgpack_type
(
migraphx
::
rank
<
1
>
,
const
T
&
src
)
->
decltype
(
src
.
empty
(),
std
::
vector
<
T
>
{})
{
if
(
src
.
empty
())
return
{};
return
{
src
};
}
template
<
class
T
>
std
::
vector
<
char
>
msgpack_buffer
(
const
T
&
src
)
{
std
::
stringstream
buffer
;
msgpack
::
pack
(
buffer
,
src
);
msgpack
::
pack
(
buffer
,
msgpack_type
(
migraphx
::
rank
<
2
>
{},
src
)
)
;
buffer
.
seekg
(
0
);
std
::
string
str
=
buffer
.
str
();
return
std
::
vector
<
char
>
(
str
.
data
(),
str
.
data
()
+
str
.
size
());
// NOLINT
...
...
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