Skip to content

Commit

Permalink
Merge pull request #632 from tomopy/ci-cuda
Browse files Browse the repository at this point in the history
CI: Add CUDA back into CI build matrix
  • Loading branch information
carterbox committed Nov 10, 2023
2 parents 87291c1 + c502b04 commit 19b6783
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 12 deletions.
12 changes: 9 additions & 3 deletions azure-pipelines.yml
Expand Up @@ -68,9 +68,15 @@ jobs:
Python-nomkl:
python.version: 'nomkl'
use.mkl: 'OFF'
use.cuda: 'OFF'
Python-38:
python.version: '38'
use.mkl: 'ON'
use.cuda: 'OFF'
Python-cuda:
python.version: 'cuda'
use.mkl: 'ON'
use.cuda: 'ON'
maxParallel: 4
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
Expand All @@ -88,9 +94,9 @@ jobs:
echo "C compiler is ${CC}"
echo "C++ compiler is ${CXX}"
pip install . --no-deps
cmake -S . -B build -GNinja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DTOMOPY_USE_MKL:BOOL=$(use.mkl)
cmake --build build
cmake --install build
cmake -S . -B build -GNinja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DTOMOPY_USE_MKL:BOOL=$(use.mkl) -DTOMOPY_USE_CUDA:BOOL=$(use.cuda)
cmake --build build -v
cmake --install build -v
displayName: Setup and install
- script: |
source activate tomopy
Expand Down
30 changes: 30 additions & 0 deletions envs/linux-cuda.yml
@@ -0,0 +1,30 @@
name: tomopy
channels:
- conda-forge
dependencies:
- c-compiler
- cmake
- cuda-nvcc_linux-64
- cxx-compiler
- dxchange
- git
- h5py
- libgomp
- libnpp-dev
- ninja
- numexpr
- numpy<1.22.4|>=1.23.0
- python
- pywavelets
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
# Optional packages
# - pyctest>0.0.10
# - timemory=*=py37h* # the nompi build
- mkl
- mkl-devel
- mkl_fft
- pytest
- pytest-cov
16 changes: 8 additions & 8 deletions source/libtomo/accel/utils.hh
Expand Up @@ -52,14 +52,6 @@ END_EXTERN_C
# define _Complex
#endif

#if defined(TOMOPY_USE_OPENCV)

# define CPU_NN CV_INTER_NN
# define CPU_LINEAR CV_INTER_LINEAR
# define CPU_AREA CV_INTER_AREA
# define CPU_CUBIC CV_INTER_CUBIC
# define CPU_LANCZOS CV_INTER_LANCZOS4

//--------------------------------------------------------------------------------------//

// a non-string environment option with a string identifier
Expand Down Expand Up @@ -116,6 +108,14 @@ GetChoice(const EnvChoiceList<Tp>& _choices, const std::string& str_var)
abort();
}

#if defined(TOMOPY_USE_OPENCV)

# define CPU_NN CV_INTER_NN
# define CPU_LINEAR CV_INTER_LINEAR
# define CPU_AREA CV_INTER_AREA
# define CPU_CUBIC CV_INTER_CUBIC
# define CPU_LANCZOS CV_INTER_LANCZOS4

//--------------------------------------------------------------------------------------//

template <typename _Tp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_tomopy/test_recon/test_rotation.py
Expand Up @@ -55,7 +55,7 @@
find_center_pc
#from tomopy.util.mproc import get_rank, get_nproc, barrier
import numpy as np
from scipy.ndimage.interpolation import shift as image_shift
from scipy.ndimage import shift as image_shift
from scipy.ndimage import zoom
import os.path
import shutil
Expand Down

0 comments on commit 19b6783

Please sign in to comment.