Skip to content

Commit

Permalink
ENH: Remove ITKCudaCommon from the source tree
Browse files Browse the repository at this point in the history
Now builds with the remote module CudaCommon of ITK. Builds both as a
remote module of ITK and as a standalone library.
  • Loading branch information
AlexyPellegrini authored and Simon Rit committed Mar 13, 2023
1 parent 02005d7 commit efb54dc
Show file tree
Hide file tree
Showing 33 changed files with 65 additions and 2,841 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-test-cxx-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push,pull_request]

env:
itk-git-tag: "v5.3.0"
itk-module-deps: "CudaCommon@7f9a395c4c61e1757d0cdee82da7248b2117f3f2"

jobs:
build-test-cxx:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build-test-package-python-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ on: [push,pull_request]
env:
cmake-options: '-DRTK_BUILD_APPLICATIONS:BOOL=OFF -DRTK_CUDA_VERSION=11.6'
itk-wheel-tag: 'v5.3.0'
itk-python-package-tag: 'ee05fd4fa5feedc32afbed32b84b9c9eb0518036'
itk-python-package-org: 'InsightSoftwareConsortium'
itk-python-package-tag: 'e41b75c7d7c5f1d74860e0765760e11b8ee5033c'
itk-python-package-org: 'SimonRit'
itk-module-deps: "RTKConsortium/ITKCudaCommon@7f9a395c4c61e1757d0cdee82da7248b2117f3f2"

jobs:
build-linux-cuda-python-packages:
Expand Down Expand Up @@ -37,7 +38,7 @@ jobs:
export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }}
export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }}
export ITK_MODULE_PREQ=${{ env.itk-module-deps }}
CMAKE_OPTIONS="--cmake_options ${{ env.cmake-options }} -DCUDAToolkit_ROOT=/usr/lib64/cuda116 -DCMAKE_CUDA_COMPILER=/usr/lib64/cuda116/bin/nvcc"
CMAKE_OPTIONS=(--cmake_options "${{ env.cmake-options }} -DCUDAToolkit_ROOT=/usr/lib64/cuda116 -DCMAKE_CUDA_COMPILER=/usr/lib64/cuda116/bin/nvcc")
export LD_LIBRARY_PATH="/home/srit/Downloads/cuda116:/home/srit/Downloads/cuda116/targets/x86_64-linux/lib:/home/srit/Downloads/cuda116/lib64/stubs"
if test -e ../../ITKPythonBuilds-linux-manylinux2014.tar.zst ; then
mv ../../*zst .
Expand All @@ -48,7 +49,7 @@ jobs:
export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)`
export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)`
echo "Building for manylinux specialization ${MANYLINUX_VERSION} and target architecture ${TARGET_ARCH}"
./dockcross-manylinux-download-cache-and-build-module-wheels.sh $CMAKE_OPTIONS -x "libcuda.so;libcuda.so.1;libcudart.so;libcudart.so.11.0;libcublas.so;libcublas.so.11;libcublasLt.so;libcublasLt.so.11;libcufft.so;libcufft.so.10" cp${{ matrix.python-version }}
./dockcross-manylinux-download-cache-and-build-module-wheels.sh "${CMAKE_OPTIONS[@]}" -x "libcuda.so;libcuda.so.1;libcudart.so;libcudart.so.11.0;libcublas.so;libcublas.so.11;libcublasLt.so;libcublasLt.so.11;libcufft.so;libcufft.so.10" cp${{ matrix.python-version }}
mv *zst ../..
- name: Publish Python package as GitHub Artifact
Expand Down
13 changes: 0 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ list(APPEND RTK_INCLUDE_DIRS
"${LPSOLVE_INCLUDE_DIRS}")

#=========================================================
# ITKCudaCommon
#=========================================================
if(RTK_USE_CUDA)
if(NOT TARGET ITKCudaCommon)
add_subdirectory(utilities/ITKCudaCommon)
endif()
endif()
list(APPEND RTK_INCLUDE_DIRS
${ITKCudaCommon_INCLUDE_DIRS})
#=========================================================
# Include directories
#=========================================================
list(APPEND RTK_INCLUDE_DIRS
Expand Down Expand Up @@ -223,9 +213,6 @@ if(NOT ITK_SOURCE_DIR)
# This must be done after RTK has been loaded by ITK to make sure
# ${itk-module} variables are defined for RTK.
itk_module_target_export(lpsolve55)
if(RTK_USE_CUDA)
itk_module_target_export(ITKCudaCommon)
endif()

if(${ITK_VERSION} VERSION_LESS 5.3)
## Set the default target properties for RTK
Expand Down
6 changes: 2 additions & 4 deletions itk-module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ set(RTK_TEST_DEPENDS

# # -----------------------------------------
# # CUDA optional dependencies
if(ITK_SOURCE_DIR)
if(${RTK_USE_CUDA})
list(APPEND RTK_DEPENDS ITKCudaCommon)
endif()
if(${RTK_USE_CUDA})
list(APPEND RTK_DEPENDS CudaCommon)
endif()

#=========================================================
Expand Down
6 changes: 2 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,9 @@ endif()
#=========================================================

itk_module_add_library(RTK ${RTK_SRCS})
target_link_libraries(RTK LINK_PUBLIC lpsolve55)
target_link_libraries(RTK PUBLIC lpsolve55)

if (RTK_USE_CUDA)
target_link_libraries(RTK LINK_PUBLIC ITKCudaCommon)
target_link_libraries(RTK LINK_PUBLIC CUDA::cufft)
target_link_libraries(RTK LINK_PUBLIC CUDA::cublas)
target_link_libraries(RTK PUBLIC CUDA::cufft CUDA::cublas)
set_property(TARGET RTK PROPERTY CUDA_STANDARD ${CMAKE_CXX_STANDARD})
endif ()
43 changes: 0 additions & 43 deletions utilities/ITKCudaCommon/CMakeLists.txt

This file was deleted.

202 changes: 0 additions & 202 deletions utilities/ITKCudaCommon/LICENSE

This file was deleted.

Empty file removed utilities/ITKCudaCommon/README
Empty file.
Loading

0 comments on commit efb54dc

Please sign in to comment.