cuDNNのアルゴリズムデータ読み書きの例外対策

This commit is contained in:
lltcggie 2016-07-06 22:33:09 +09:00
parent 2ea99797c6
commit aba4f717fb

View File

@ -318,12 +318,19 @@ private:
fclose(fp);
try
{
CcuDNNAlgorithmElement elm;
msgpack::unpack(sbuf.data(), sbuf.size()).get().convert(elm);
sbuf.clear();
const uint64_t key = InfoToKey(kernel_w, kernel_h, pad_w, pad_h, stride_w, stride_h, batch_size);
mAlgoEmlMap[key] = std::move(elm);
}
catch (...)
{
boost::filesystem::remove(SavePath);
}
return true;
}
@ -372,6 +379,8 @@ public:
{
auto &eml = p.second;
if (eml.IsModefy())
{
try
{
msgpack::sbuffer sbuf;
msgpack::pack(sbuf, eml);
@ -390,6 +399,9 @@ public:
eml.Saved();
}
}
catch(...)
{}
}
}
}