From 135015685959c6168930951fcb50d46bc9aeddd7 Mon Sep 17 00:00:00 2001 From: algol Date: Mon, 13 Aug 2018 16:39:25 +0100 Subject: fixed matlab wrappers compilation GPU --- Wrappers/Matlab/CMakeLists.txt | 45 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index cd46051..837993d 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -75,18 +75,18 @@ foreach(tgt RANGE 0 ${num}) NAME ${current_target} SRC ${current_file_name} - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_TV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/SB_TV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TGV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffusion_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffus4th_order_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/LLT_ROF_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/ROF_TV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_dTV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TNV_core.c - ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/utils.c - ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/Diffusion_Inpaint_core.c - ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_TV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/SB_TV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TGV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffusion_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/Diffus4th_order_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/LLT_ROF_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/ROF_TV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/FGP_dTV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/TNV_core.c + #${CMAKE_SOURCE_DIR}/Core/regularisers_CPU/utils.c + #${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/Diffusion_Inpaint_core.c + #${CMAKE_SOURCE_DIR}/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c LINK_TO cilreg ${Matlab_LIBRARIES} ) @@ -107,26 +107,33 @@ if (BUILD_CUDA) find_package(CUDA) if (CUDA_FOUND) file(GLOB GPU_MEX_FILES - "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.c" + "${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_GPU/*.cpp" ) list(LENGTH GPU_MEX_FILES num) - +message("number of GPU files " ${num}) MATH(EXPR num "${num}-1") #set(num "-1") foreach(tgt RANGE ${num}) message("number " ${tgt}) - #list(GET CPU_TARGETS ${tgt} current_target) - list(GET GPU_MEX_FILES ${tgt} current_file) - get_filename_component(current_target ${current_file} NAME) + list(LENGTH GPU_MEX_FILES num2) + message("the list is ${num2}") + #list(GET CPU_TARGETS ${tgt} current_target) + list(GET GPU_MEX_FILES ${tgt} current_file_name) + get_filename_component(current_file ${current_file_name} NAME) + string(REGEX MATCH "(.+).c" match ${current_file}) + if (NOT ${match} EQUAL "" ) + set (current_target ${CMAKE_MATCH_1}) + endif() + message("matlab_add_mex target " ${current_file} " and " ${current_target}) message("matlab_add_mex " ${current_target}) matlab_add_mex( NAME ${current_target} SRC - ${current_file} - LINK_TO cilreg ${Matlab_LIBRARIES} + ${current_file_name} + LINK_TO cilregcuda ${Matlab_LIBRARIES} ) target_include_directories(${current_target} -- cgit v1.2.3