!20110 fix the test case of CPU dump

Merge pull request !20110 from limingqi107/bug_fix
This commit is contained in:
i-robot 2021-07-13 15:57:44 +00:00 committed by Gitee
commit 0f6d55289f
2 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,9 @@ namespace device {
namespace gpu {
void GPUDeviceManager::InitDevice() {
CHECK_OP_RET_WITH_EXCEPT(CudaDriver::SetDevice(SizeToInt(cur_dev_id_)), "Failed to set current device id");
if (dev_alive_) {
return;
}
CHECK_OP_RET_WITH_EXCEPT(CreateStream(&default_stream_), "Failed to create CUDA stream.");
CHECK_CUDNN_RET_WITH_EXCEPT_NOTRACE(cudnnCreate(&cudnn_handle_), "Failed to create cuDNN handle");
CHECK_CUDNN_RET_WITH_EXCEPT_NOTRACE(cudnnSetStream(cudnn_handle_, reinterpret_cast<cudaStream_t>(default_stream())),

View File

@ -90,6 +90,9 @@ def run_e2e_dump():
if context.get_context("device_target") == "Ascend":
assert len(os.listdir(dump_file_path)) == 5
output_name = "Add.Add-op1.0.0.*.output.0.DefaultFormat.npy"
elif context.get_context("device_target") == "CPU":
assert len(os.listdir(dump_file_path)) == 5
output_name = "Add.Add-op3.0.0.*.output.0.DefaultFormat.npy"
else:
assert len(os.listdir(dump_file_path)) == 3
output_name = "Add.Add-op3.0.0.*.output.0.DefaultFormat.npy"