"docs/_removed/Tuner/MetisTuner.rst" did not exist on "c241f772a674acba7a3efc96e161af4e9af49459"
Commit 88f80be7 authored by Paul's avatar Paul
Browse files

Fix compile errors

parent 631c1b52
......@@ -23,44 +23,45 @@
*/
#include <migraphx/msgpack.hpp>
#include <migraphx/serialize.hpp>
#include <migraphx/functional.hpp>
#include <msgpack.hpp>
#include <variant>
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
// namespace migraphx {
// inline namespace MIGRAPHX_INLINE_NS {
struct msgpack_chunk
{
std::vector<value> chunks;
// struct msgpack_chunk
// {
// std::vector<value> chunks;
value as_value() const
{
if(chunks.empty())
return {};
const value& v = chunks.front();
if(v.is_array() or v.is_object())
{
std::vector<value> values = v.is_array() ? v.get_array() : v.get_object();
std::for_each(chunks.begin() + 1, chunks.end(), [&](const auto& chunk) {
values.insert(values.end(), chunk.begin(), chunk.end());
});
return values;
}
else if(v.is_binary())
{
value::binary data = v.get_binary();
std::for_each(chunks.begin() + 1, chunks.end(), [&](const auto& chunk) {
const value::binary& b = chunk.get_binary();
data.insert(data.end(), b.begin(), b.end());
});
return data;
}
MIGRAPHX_THROW("Incorrect chunking");
}
};
// value as_value() const
// {
// if(chunks.empty())
// return {};
// const value& v = chunks.front();
// if(v.is_array() or v.is_object())
// {
// std::vector<value> values = v.is_array() ? v.get_array() : v.get_object();
// std::for_each(chunks.begin() + 1, chunks.end(), [&](const auto& chunk) {
// values.insert(values.end(), chunk.begin(), chunk.end());
// });
// return values;
// }
// else if(v.is_binary())
// {
// value::binary data = v.get_binary();
// std::for_each(chunks.begin() + 1, chunks.end(), [&](const auto& chunk) {
// const value::binary& b = chunk.get_binary();
// data.insert(data.end(), b.begin(), b.end());
// });
// return data;
// }
// MIGRAPHX_THROW("Incorrect chunking");
// }
// };
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx
// } // namespace MIGRAPHX_INLINE_NS
// } // namespace migraphx
namespace msgpack {
MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS)
......@@ -125,13 +126,12 @@ MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS)
}
default: MIGRAPHX_THROW("Incorrect chunking");
}
}
std::for_each(
o.via.array.ptr,
o.via.array.ptr + o.via.array.size,
[&](const msgpack::object& sa) {
std::visit(
overload(
migraphx::overload(
[&](migraphx::value::binary& bin) {
bin.insert(
bin.end(), o.via.bin.ptr, o.via.bin.ptr + o.via.bin.size);
......@@ -164,9 +164,9 @@ MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS)
case msgpack::type::EXT: {
MIGRAPHX_THROW("msgpack EXT type not supported.");
}
}
return o;
}
}
};
template <>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment