MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / serialize_write_pod

Method serialize_write_pod

dnn/include/megdnn/oprs/base.h:190–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189 template <typename T>
190 static void serialize_write_pod(const T& val, std::string& result) {
191 static_assert(
192 std::is_trivially_copyable<T>::value,
193 "type should be trivially copyable");
194 static_assert(
195 !std::is_pointer<T>::value,
196 "serialize pointer is unsafe in eager execution mode");
197 result.append(reinterpret_cast<const char*>(&val), sizeof(T));
198 }
199
200 static void serialize_write_pod(const char* val, std::string& result) {
201 result.append(val, strlen(val));

Callers

nothing calls this directly

Calls 3

appendMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected