diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2018-02-21 12:49:59 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2018-02-21 12:49:59 +0000 |
commit | 75917255b4f0b8aae2e6ce9492a75e0f749bfb3e (patch) | |
tree | 67ee3abb9dc7a0c8b34a81cee8ecc4a6b0eb68de | |
parent | b8e4e8d89432cfaa860835d873b52e4df40d92d5 (diff) | |
download | regularization-75917255b4f0b8aae2e6ce9492a75e0f749bfb3e.tar.gz regularization-75917255b4f0b8aae2e6ce9492a75e0f749bfb3e.tar.bz2 regularization-75917255b4f0b8aae2e6ce9492a75e0f749bfb3e.tar.xz regularization-75917255b4f0b8aae2e6ce9492a75e0f749bfb3e.zip |
added TV_ROF
-rw-r--r-- | Core/CMakeLists.txt | 3 | ||||
-rwxr-xr-x | Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.cu | 2 | ||||
-rwxr-xr-x | Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.h | 3 | ||||
-rw-r--r-- | Wrappers/Python/src/gpu_regularizers.pyx | 8 | ||||
-rw-r--r-- | Wrappers/Python/test/test_gpu_regularizers.py | 2 |
5 files changed, 10 insertions, 8 deletions
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 3202581..3e3f89e 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -88,7 +88,7 @@ add_library(cilreg SHARED ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_CPU/PatchBased_Regul_core.c ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_CPU/SplitBregman_TV_core.c ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_CPU/TGV_PD_core.c - ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_CPU/ROF_TV_core.c + ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_CPU/ROF_TV_core.c ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_CPU/utils.c ) target_link_libraries(cilreg ${EXTRA_LIBRARIES} ) @@ -129,6 +129,7 @@ if (CUDA_FOUND) CUDA_ADD_LIBRARY(cilregcuda SHARED ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_GPU/Diffus_HO/Diff4th_GPU_kernel.cu ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_GPU/NL_Regul/NLM_GPU_kernel.cu + ${CMAKE_CURRENT_SOURCE_DIR}/regularizers_GPU/TV_ROF/TV_ROF_GPU.cu ) if (UNIX) message ("I'd install into ${CMAKE_INSTALL_PREFIX}/lib") diff --git a/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.cu b/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.cu index 633bf63..73a52e1 100755 --- a/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.cu +++ b/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.cu @@ -306,7 +306,7 @@ __host__ __device__ int sign (float x) ///////////////////////////////////////////////// // HOST FUNCTION -extern "C" void TV_ROF_GPU(float* Input, float* Output, int N, int M, int Z, int iter, float tau, float lambda) +extern "C" void TV_ROF_GPU_kernel(float* Input, float* Output, int N, int M, int Z, int iter, float tau, float lambda) { // set up device int dev = 0; diff --git a/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.h b/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.h index 3163482..2938d2f 100755 --- a/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.h +++ b/Core/regularizers_GPU/TV_ROF/TV_ROF_GPU.h @@ -1,7 +1,8 @@ #ifndef __TVGPU_H__ #define __TVGPU_H__ #include "CCPiDefines.h" +#include <stdio.h> -extern "C" CCPI_EXPORT void TV_ROF_GPU(float* Input, float* Output, int N, int M, int Z, int iter, float tau, float lambda); +extern "C" CCPI_EXPORT void TV_ROF_GPU_kernel(float* Input, float* Output, int N, int M, int Z, int iter, float tau, float lambda); #endif diff --git a/Wrappers/Python/src/gpu_regularizers.pyx b/Wrappers/Python/src/gpu_regularizers.pyx index 5a5d274..fcb91cc 100644 --- a/Wrappers/Python/src/gpu_regularizers.pyx +++ b/Wrappers/Python/src/gpu_regularizers.pyx @@ -25,7 +25,7 @@ cdef extern void NLM_GPU_kernel(float *A, float* B, float *Eucl_Vec, int N, int M, int Z, int dimension, int SearchW, int SimilW, int SearchW_real, float denh2, float lambdaf); -cdef extern void TV_ROF_GPU(float* A, float* B, int N, int M, int Z, int iter, float tau, float lambdaf); +cdef extern void TV_ROF_GPU_kernel(float* A, float* B, int N, int M, int Z, int iter, float tau, float lambdaf); cdef extern float pad_crop(float *A, float *Ap, int OldSizeX, int OldSizeY, int OldSizeZ, int NewSizeX, int NewSizeY, int NewSizeZ, @@ -67,7 +67,7 @@ def NML(inputData, h, lambdaf) -def ROF_TV_GPU(inputData, +def GPU_ROF_TV(inputData, iterations, time_marching_parameter, regularization_parameter): @@ -343,7 +343,7 @@ def ROFTV2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, np.zeros([dims[0],dims[1]], dtype='float32') # Running CUDA code here - TV_ROF_GPU( + TV_ROF_GPU_kernel( &inputData[0,0], &B[0,0], dims[0], dims[1], 0, iterations , @@ -366,7 +366,7 @@ def ROFTV3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, np.zeros([dims[0],dims[1],dims[2]], dtype='float32') # Running CUDA code here - TV_ROF_GPU( + TV_ROF_GPU_kernel( &inputData[0,0,0], &B[0,0,0], dims[0], dims[1], dims[2], iterations , diff --git a/Wrappers/Python/test/test_gpu_regularizers.py b/Wrappers/Python/test/test_gpu_regularizers.py index 735a25d..75127a6 100644 --- a/Wrappers/Python/test/test_gpu_regularizers.py +++ b/Wrappers/Python/test/test_gpu_regularizers.py @@ -13,7 +13,7 @@ import numpy as np import os from enum import Enum import timeit -from ccpi.filters.gpu_regularizers import Diff4thHajiaboli, NML +from ccpi.filters.gpu_regularizers import Diff4thHajiaboli, NML, GPU_ROF_TV ############################################################################### def printParametersToString(pars): txt = r'' |