提交 5813433e authored 作者: Mathieu Germain's avatar Mathieu Germain

fixed old bug in new backend

上级 724288d2
...@@ -92,12 +92,12 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns, ...@@ -92,12 +92,12 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
} }
algo = choice.algo; algo = choice.algo;
#else #else
size_t free = 0, total = 0; size_t free;
cudaError_t err2 = cudaMemGetInfo(&free, &total); int err2 = c->ops->property(c->ctx, NULL, NULL, GA_CTX_PROP_FREE_GMEM, &free);
if (err2 != cudaSuccess) {
if (err2 != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, "Error when trying to find the " PyErr_Format(PyExc_RuntimeError, "Error when trying to find the "
"memory information on the GPU: %s\n", "memory information on the GPU");
cudaGetErrorString(err2));
cuda_exit(c->ctx); cuda_exit(c->ctx);
return 1; return 1;
} }
......
...@@ -91,12 +91,12 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output, ...@@ -91,12 +91,12 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output,
algo = choice.algo; algo = choice.algo;
#else #else
size_t free = 0, total = 0; size_t free;
cudaError_t err2 = cudaMemGetInfo(&free, &total); int err2 = c->ops->property(c->ctx, NULL, NULL, GA_CTX_PROP_FREE_GMEM, &free);
if (err2 != cudaSuccess){
cudaGetLastError(); if (err2 != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, "Error when trying to find the memory " PyErr_Format(PyExc_RuntimeError, "Error when trying to find the "
"information on the GPU: %s\n", cudaGetErrorString(err2)); "memory information on the GPU");
cuda_exit(c->ctx); cuda_exit(c->ctx);
return 1; return 1;
} }
......
...@@ -92,12 +92,12 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output, ...@@ -92,12 +92,12 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
algo = choice.algo; algo = choice.algo;
#else #else
size_t free = 0, total = 0; size_t free;
cudaError_t err2 = cudaMemGetInfo(&free, &total); int err2 = c->ops->property(c->ctx, NULL, NULL, GA_CTX_PROP_FREE_GMEM, &free);
if (err2 != cudaSuccess){
cudaGetLastError(); if (err2 != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, "Error when trying to find the memory " PyErr_Format(PyExc_RuntimeError, "Error when trying to find the "
"information on the GPU: %s\n", cudaGetErrorString(err2)); "memory information on the GPU");
cuda_exit(c->ctx); cuda_exit(c->ctx);
return 1; return 1;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论