message: Add GPU builds to CI
diff: @@ -5,6 +5,7 @@ stages:
  - build
  - test
  +# Templates with reasonable defaults for builds and tests
  .job_templates:
  .variables_template: &default_variables
  C_COMPILER: gcc
  @@ -13,33 +14,40 @@ stages:
  BUILD_REFERENCE: "ON"
  BUILD_CPU: "OFF"
  BUILD_GPU: "OFF"
  + EXTRA_CMAKE_FLAGS: ""
  EXTRA_PACKAGES: ""
  + .before_script_template: &default_before_script
  + - pacman-db-upgrade
  + - pacman --noconfirm -Syu cmake git python ${EXTRA_PACKAGES}
  +
  .build_template: &default_build
  stage: build
  variables: *default_variables
  - before_script:
  - - pacman-db-upgrade
  - - pacman --noconfirm -Syu cmake git ${EXTRA_PACKAGES}
  + before_script: *default_before_script
  script:
  + - env
  + - echo ${CMAKE_EXTRA_FLAGS}
  - mkdir -p ${CI_JOB_NAME} && cd ${CI_JOB_NAME}
  - cmake ${CI_PROJECT_DIR}
  -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER}
  -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDEVEL_TOOLS=OFF
  -DBUILD_REFERENCE=${BUILD_REFERENCE} -DBUILD_CPU=${BUILD_CPU}
  - -DBUILD_GPU=${BUILD_GPU}
  - -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON
  - - make -j$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
  + -DBUILD_GPU=${BUILD_GPU} -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON
  + ${EXTRA_CMAKE_FLAGS}
  + - make VERBOSE=1 -j$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
  artifacts:
  paths:
  - build/
  .test_template: &default_test
  stage: test
  + before_script: *default_before_script
  script:
  - cd ${CI_JOB_NAME/test/build}
  - make test
  +# Build jobs
  build/gcc/reference/debug:
  <<: *default_build
  @@ -51,7 +59,29 @@ build/clang/reference/debug:
  CXX_COMPILER: clang++
  EXTRA_PACKAGES: clang
  +build/gcc/all/debug:
  + <<: *default_build
  + variables:
  + <<: *default_variables
  + EXTRA_PACKAGES: cuda
  + BUILD_CPU: "ON"
  + BUILD_GPU: "ON"
  + EXTRA_CMAKE_FLAGS: &cuda_flags
  + -DCMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc -DCUDA_ARCH_OPTION=60
  + -DBUILD_SHARED_LIBS=ON
  +
  +build/clang/all/debug:
  + <<: *default_build
  + variables:
  + <<: *default_variables
  + EXTRA_PACKAGES: clang cuda
  + C_COMPILER: clang
  + CXX_COMPILER: clang++
  + BUILD_CPU: "ON"
  + BUILD_GPU: "ON"
  + EXTRA_CMAKE_FLAGS: *cuda_flags
  +# Test jobs
  test/gcc/reference/debug:
  <<: *default_test
  dependencies:
  