提交 89ecbaf9 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix the problem for the new backend too.

上级 058458f0
...@@ -92,12 +92,14 @@ PyGpuArray_conv_valid(const PyGpuArrayObject *img, ...@@ -92,12 +92,14 @@ PyGpuArray_conv_valid(const PyGpuArrayObject *img,
} }
//Check the output size is valid //Check the output size is valid
assert (PyGpuArray_DIMS(out)[2] == ceil_intdiv(PyGpuArray_DIMS(img)[2]- PyGpuArray_DIMS(kern)[2] + 1, subsample_rows)); if (!(PyGpuArray_DIMS(out)[2] == ceil_intdiv(PyGpuArray_DIMS(img)[2]- PyGpuArray_DIMS(kern)[2] + 1, subsample_rows) ||
assert (PyGpuArray_DIMS(out)[3] == ceil_intdiv(PyGpuArray_DIMS(img)[3]- PyGpuArray_DIMS(kern)[3] + 1, subsample_cols)); PyGpuArray_DIMS(out)[3] == ceil_intdiv(PyGpuArray_DIMS(img)[3]- PyGpuArray_DIMS(kern)[3] + 1, subsample_cols) ||
PyGpuArray_DIMS(out)[0] == PyGpuArray_DIMS(img)[0] ||
assert (PyGpuArray_DIMS(out)[0] == PyGpuArray_DIMS(img)[0]); PyGpuArray_DIMS(out)[1] == PyGpuArray_DIMS(kern)[0] ||
assert (PyGpuArray_DIMS(out)[1] == PyGpuArray_DIMS(kern)[0]); PyGpuArray_DIMS(img)[1] == PyGpuArray_DIMS(kern)[1])) {
assert (PyGpuArray_DIMS(img)[1] == PyGpuArray_DIMS(kern)[1]); PyErr_SetString(PyExc_ValueError, "GpuConv: sizes don't match");
return -1;
}
// we now search through a few implementations until one applies to our arguments. // we now search through a few implementations until one applies to our arguments.
......
...@@ -187,7 +187,7 @@ class GpuConv(gof.Op): ...@@ -187,7 +187,7 @@ class GpuConv(gof.Op):
def c_code_cache_version(self): def c_code_cache_version(self):
# raise this whenever modifying any of the support_code_files # raise this whenever modifying any of the support_code_files
return (0, 20) return (0, 21)
def c_init_code(self): def c_init_code(self):
return ['cuda_get_ptr_raw = (CUdeviceptr (*)(gpudata *g))gpuarray_get_extension("cuda_get_ptr");'] return ['cuda_get_ptr_raw = (CUdeviceptr (*)(gpudata *g))gpuarray_get_extension("cuda_get_ptr");']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论