Skip to content

Commit

Permalink
Travis build for OpenCL version (CMU-Perceptual-Computing-Lab#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulslicer authored and gineshidalgo99 committed Feb 13, 2019
1 parent 9f891d0 commit 99855c6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ matrix:
osx_image: xcode9.4 # xcode10.1 does not work with Python # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
env: NAME="OSX-python-cmake-cpu-unity" WITH_CUDA=false WITH_PYTHON=true WITH_UNITY=true
sudo: required
# Mac OSX - Default - CMake - OpenCL
- os: osx
osx_image: xcode10.1 # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
env: NAME="OSX-default-cmake-opencl" WITH_CUDA=false WITH_OPEN_CL=true
sudo: required

# # TO-DO: To be implemented
# # Windows
Expand All @@ -98,11 +103,11 @@ matrix:
# dist: xenial
# env: NAME="U16-default-cmake-cpu-mkl" WITH_CUDA=false WITH_MKL=true
# sudo: required
# # Ubuntu 16.04 - Default - CMake - OpenCL
# - os: linux
# dist: xenial
# env: NAME="U16-default-cmake-opencl" WITH_CUDA=false WITH_OPEN_CL=true
# sudo: required
# Ubuntu 16.04 - Default - CMake - OpenCL
- os: linux
dist: xenial
env: NAME="U16-default-cmake-opencl" WITH_CUDA=false WITH_OPEN_CL=true
sudo: required
# # Ubuntu 16.04 - Python - CMake - OpenCL
# - os: linux
# dist: xenial
Expand Down
11 changes: 8 additions & 3 deletions scripts/travis/configure_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ if [[ $WITH_CUDA == true ]] ; then
ARGS="$ARGS -DGPU_MODE=CUDA -DCUDA_ARCH=Manual -DCUDA_ARCH_BIN=\"52\" -DCUDA_ARCH_PTX=\"\""
# OpenCL version
elif [[ $WITH_OPEN_CL == true ]] ; then
echo "OpenCL version not implemented for Travis Build yet."
exit 99
ARGS="$ARGS -DGPU_MODE=OPENCL"
# CPU version
else
ARGS="$ARGS -DGPU_MODE=CPU_ONLY"
Expand Down Expand Up @@ -64,7 +63,13 @@ echo "ARGS = ${ARGS}."

cmake .. $ARGS

# Patch for OpenCL and OSX
if [[ $WITH_OPEN_CL == true && $TRAVIS_OS_NAME == "osx" ]] ; then
cd ../3rdparty/caffe; git apply ../../scripts/osx/mac_opencl_patch.txt;
cd ../../build;
fi

# Run Cmake twice for pybind to register
if [[ $WITH_PYTHON == true ]] ; then
cmake .. $ARGS
fi
fi
1 change: 1 addition & 0 deletions scripts/travis/defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ WITH_OPEN_CL=${WITH_OPEN_CL:-false}
WITH_MKL=${WITH_MKL:-false}
WITH_UNITY=${WITH_UNITY:-false}
WITH_DEBUG=${WITH_DEBUG:-false}
TRAVIS_OS_NAME=${TRAVIS_OS_NAME}

# Examples should be run (Travis not compatible with GPU code)
# if [[ $WITH_CMAKE == true ]] && [[ $WITH_PYTHON == true ]] && [[ $WITH_CUDA == false ]] && [[ $WITH_OPEN_CL == false ]] && [[ $WITH_MKL == false ]]; then
Expand Down
3 changes: 3 additions & 0 deletions scripts/ubuntu/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ sudo apt-get --assume-yes install python3-pip
sudo -H pip3 install --upgrade numpy protobuf opencv-python
# OpenCV 2.4 -> Added as option
# # sudo apt-get --assume-yes install libopencv-dev
# OpenCL Generic
sudo apt-get --assume-yes install opencl-headers ocl-icd-opencl-dev
sudo apt-get --assume-yes install libviennacl-dev

0 comments on commit 99855c6

Please sign in to comment.