Commit d16a087d by liyinqiao

Bug fixed.

Fix the bugs in FlushToMem functions.
parent 192bad4b
...@@ -1933,7 +1933,10 @@ void XTensor::FlushToMem(XMem* targetMem) ...@@ -1933,7 +1933,10 @@ void XTensor::FlushToMem(XMem* targetMem)
else if (mem != targetMem) { else if (mem != targetMem) {
void* tmpData = targetMem->Alloc(targetMem->devID, GetDataSizeInChar()); void* tmpData = targetMem->Alloc(targetMem->devID, GetDataSizeInChar());
XMemCopy(tmpData, targetMem->devID, data, devID, GetDataSizeInChar()); XMemCopy(tmpData, targetMem->devID, data, devID, GetDataSizeInChar());
mem->Release(data, GetDataSizeInChar(), signature); if (mem != NULL)
mem->Release(data, GetDataSizeInChar(), signature);
else
XMemFree(devID, data);
data = tmpData; data = tmpData;
mem = targetMem; mem = targetMem;
devID = mem->devID; devID = mem->devID;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论