From 0261bc73703c835c8c15fd47229317f44d1663ea Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 30 Jan 2018 11:36:59 +0000 Subject: fix GPU regularizer --- Wrappers/Python/CMakeLists.txt | 3 ++- Wrappers/Python/src/gpu_regularizers.pyx | 39 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index 3f95660..16a2137 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -89,7 +89,8 @@ message ("found " ${BOOST_NUMPY_LIB}) find_package(CUDA) if (CUDA_FOUND) message("CUDA FOUND") - set (SETUP_GPU_WRAPPERS "setup( \n\ + set (SETUP_GPU_WRAPPERS "extra_libraries += ['cilregcuda']\n\ +setup( \n\ name='ccpi', \n\ description='CCPi Core Imaging Library - Image Regularizers GPU',\n\ version=cil_version,\n\ diff --git a/Wrappers/Python/src/gpu_regularizers.pyx b/Wrappers/Python/src/gpu_regularizers.pyx index 7658e36..dc625c3 100644 --- a/Wrappers/Python/src/gpu_regularizers.pyx +++ b/Wrappers/Python/src/gpu_regularizers.pyx @@ -44,7 +44,25 @@ def Diff4thHajiaboli(inputData, regularization_parameter, iterations, edge_preserving_parameter) - + +def NML(inputData, + SearchW_real, + SimilW, + h, + lambdaf): + if inputData.ndim == 2: + return NML2D(inputData, + SearchW_real, + SimilW, + h, + lambdaf) + elif inputData.ndim == 3: + return NML3D(inputData, + SearchW_real, + SimilW, + h, + lambdaf) + def Diff4thHajiaboli2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, float regularization_parameter, int iterations, @@ -160,25 +178,6 @@ def Diff4thHajiaboli3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, return B -def NML(inputData, - regularization_parameter, - iterations, - edge_preserving_parameter): - if inputData.ndim == 2: - return NML2D(inputData, - regularization_parameter, - iterations, - edge_preserving_parameter) - elif inputData.ndim == 3: - return NML3D(inputData, - regularization_parameter, - iterations, - edge_preserving_parameter) - - #SearchW_real = (int) mxGetScalar(prhs[1]); /* the searching window ratio */ - #SimilW = (int) mxGetScalar(prhs[2]); /* the similarity window ratio */ - #h = (float) mxGetScalar(prhs[3]); /* parameter for the PB filtering function */ - #lambda = (float) mxGetScalar(prhs[4]); def NML2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, SearchW_real, -- cgit v1.2.3