提交 00466269 authored 作者: notoraptor's avatar notoraptor

Init struct variables correctly and print

infos about time-chosen algo status.
上级 ee22927e
#section init_code_struct #section init_code_struct
if (PARAMS->choose_algo) { reuse_algo = 0;
reuse_algo = 0; prev_algo = PARAMS->conv_algo;
prev_algo = PARAMS->conv_algo; memset(prev_img_dims, 0, sizeof(prev_img_dims));
if (!PARAMS->choose_once) { memset(prev_kern_dims, 0, sizeof(prev_kern_dims));
memset(prev_img_dims, 0, sizeof(prev_img_dims));
memset(prev_kern_dims, 0, sizeof(prev_kern_dims));
}
}
#section support_code_struct #section support_code_struct
...@@ -146,9 +142,12 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns, ...@@ -146,9 +142,12 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
if (count == 0) { if (count == 0) {
PyErr_SetString(PyExc_RuntimeError, "No best-timed conv fwd algorithm found"); PyErr_SetString(PyExc_RuntimeError, "No best-timed conv fwd algorithm found");
return 1; return 1;
} else { } else if (choice.status != CUDNN_STATUS_SUCCESS) {
fprintf(stderr, "(%d best-timed conv fwd algorithms)\n", count); PyErr_Format(PyExc_RuntimeError,
} "error getting best-timed FWD algo: %s",
cudnnGetErrorString(choice.status));
return 1;
} // Else, count is necessarly 1 for current implementation.
#endif #endif
} else { } else {
......
#section init_code_struct #section init_code_struct
if (PARAMS->choose_algo) { reuse_algo = 0;
reuse_algo = 0; prev_algo = PARAMS->conv_algo;
prev_algo = PARAMS->conv_algo; memset(prev_kern_dims, 0, sizeof(prev_kern_dims));
if (!PARAMS->choose_once) { memset(prev_top_dims, 0, sizeof(prev_top_dims));
memset(prev_kern_dims, 0, sizeof(prev_kern_dims));
memset(prev_top_dims, 0, sizeof(prev_top_dims));
}
}
#section support_code_struct #section support_code_struct
...@@ -186,9 +182,12 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output, ...@@ -186,9 +182,12 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output,
if (count == 0) { if (count == 0) {
PyErr_SetString(PyExc_RuntimeError, "No best-timed conv gradinput algorithm found"); PyErr_SetString(PyExc_RuntimeError, "No best-timed conv gradinput algorithm found");
return 1; return 1;
} else { } else if (choice.status != CUDNN_STATUS_SUCCESS) {
fprintf(stderr, "(%d best-timed conv gradinput algorithms)\n", count); PyErr_Format(PyExc_RuntimeError,
} "error getting best-timed gradinput algo: %s",
cudnnGetErrorString(choice.status));
return 1;
} // Else, count is necessarly 1 for current implementation.
#endif #endif
} else { } else {
......
#section init_code_struct #section init_code_struct
if (PARAMS->choose_algo) { reuse_algo = 0;
reuse_algo = 0; prev_algo = PARAMS->conv_algo;
prev_algo = PARAMS->conv_algo; memset(prev_img_dims, 0, sizeof(prev_img_dims));
if (!PARAMS->choose_once) { memset(prev_top_dims, 0, sizeof(prev_top_dims));
memset(prev_img_dims, 0, sizeof(prev_img_dims));
memset(prev_top_dims, 0, sizeof(prev_top_dims));
}
}
#section support_code_struct #section support_code_struct
...@@ -188,9 +184,12 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output, ...@@ -188,9 +184,12 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
if (count == 0) { if (count == 0) {
PyErr_SetString(PyExc_RuntimeError, "No best-timed conv gradweight algorithm found"); PyErr_SetString(PyExc_RuntimeError, "No best-timed conv gradweight algorithm found");
return 1; return 1;
} else { } else if (choice.status != CUDNN_STATUS_SUCCESS) {
fprintf(stderr, "(%d best-timed conv gradweight algorithms)\n", count); PyErr_Format(PyExc_RuntimeError,
} "error getting best-timed gradweight algo: %s",
cudnnGetErrorString(choice.status));
return 1;
} // Else, count is necessarly 1 for current implementation.
#endif #endif
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论