| 295 | } |
| 296 | |
| 297 | static Algorithm::Info::Desc deserialize_read_pod( |
| 298 | const std::string& data, size_t offset = 0) { |
| 299 | Algorithm::Info::Desc ret; |
| 300 | #define cb(_val, _type) \ |
| 301 | _val = megdnn::Algorithm::deserialize_read_pod<_type>(data.data(), offset); \ |
| 302 | offset += sizeof(_val) |
| 303 | |
| 304 | cb(ret.handle_type, megdnn::Handle::HandleType); |
| 305 | cb(ret.type, uint32_t); |
| 306 | |
| 307 | uint32_t param_size = 0; |
| 308 | uint32_t name_size = 0; |
| 309 | cb(param_size, uint32_t); |
| 310 | cb(name_size, uint32_t); |
| 311 | |
| 312 | if (param_size > 0) { |
| 313 | ret.param = std::string(data.data() + offset, param_size); |
| 314 | offset += param_size; |
| 315 | } |
| 316 | if (name_size > 0) { |
| 317 | ret.name = std::string(data.data() + offset, name_size); |
| 318 | offset += name_size; |
| 319 | } |
| 320 | return ret; |
| 321 | } |
| 322 | |
| 323 | } // namespace |
| 324 |
no test coverage detected