From dbd0c15155072572c58e065d51217017106c0653 Mon Sep 17 00:00:00 2001 From: Raul Ferreira Date: Mon, 24 Dec 2018 15:46:13 +0000 Subject: [PATCH 1/5] Add OpenCL Intel Platform to Travis CI Changes extracted from PR #804 --- .travis.yml | 158 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 136 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 85c84a78b..377749a6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,47 +104,144 @@ matrix: - OPENCL_LIB=pocl - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=101" - ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${POCL_OPENCL_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include" - # Xenial, OpenCL 1.2, New Boost Libs, C++11, Coverage + # Xenial, OpenCL 1.2 # CLANG - os: linux dist: xenial compiler: clang addons: apt: - packages: &xenial_pocl_packages_latest_boost + packages: *xenial_pocl_packages + sources: *xenial_pocl_sources + env: + - OPENCL_LIB=pocl + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102" + - ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${POCL_OPENCL_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include" + # GCC + - os: linux + dist: xenial + compiler: gcc + addons: + apt: + packages: *xenial_pocl_packages + sources: *xenial_pocl_sources + env: + - OPENCL_LIB=pocl + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102" + - ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${POCL_OPENCL_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_ENABLE_COVERAGE=ON" + + ############################################################################ + # Intel OpenCL Runtime builds (1.2, 2.0, 2.1) + ############################################################################ + + # Linux, Intel OpenCL 1.2 + # CLANG + - os: linux + dist: xenial + compiler: clang + addons: + apt: + packages: &xenial_intel_packages - g++-5 - # POCL - - libltdl-dev - - libhwloc-dev - - pkg-config - - libedit-dev + # Boost + - libboost-chrono1.58-dev + - libboost-date-time1.58-dev + - libboost-test1.58-dev + - libboost-system1.58-dev + - libboost-filesystem1.58-dev + - libboost-timer1.58-dev + - libboost-program-options1.58-dev + - libboost-thread1.58-dev # Misc - python-yaml - lcov - libopencv-dev - sources: &xenial_pocl_sources_latest_boost + sources: &xenial_intel_packages - ubuntu-toolchain-r-test env: - - OPENCL_LIB=pocl - - BOOST_VERSION="1_67_0" - - BOOST_URL="https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz" - - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102" - - ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${POCL_OPENCL_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" + - OPENCL_LIB=intel + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include" # GCC - os: linux dist: xenial compiler: gcc addons: apt: - packages: *xenial_pocl_packages_latest_boost - sources: *xenial_pocl_sources_latest_boost + packages: *xenial_intel_packages + sources: *xenial_intel_packages env: - - OPENCL_LIB=pocl - - COVERAGE=true - - BOOST_VERSION="1_67_0" - - BOOST_URL="https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz" - - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102" - - ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${POCL_OPENCL_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_ENABLE_COVERAGE=ON -DBOOST_COMPUTE_USE_CPP11=ON" + - OPENCL_LIB=intel + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include" + # Linux, Intel OpenCL 2.0 + # CLANG + - os: linux + dist: xenial + compiler: clang + addons: + apt: + packages: *xenial_intel_packages + sources: *xenial_intel_packages + env: + - OPENCL_LIB=intel + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=200" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include" + # GCC + - os: linux + dist: xenial + compiler: gcc + addons: + apt: + packages: *xenial_intel_packages + sources: *xenial_intel_packages + env: + - OPENCL_LIB=intel + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=200" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include" + # Linux, Intel OpenCL 2.1, New Boost Libs, C++11, Coverage + # CLANG + - os: linux + dist: xenial + compiler: clang + cache: + ccache: true + directories: + - ${DEPS_DIR}/boost + addons: + apt: + packages: &xenial_intel_latest_boost_packages + - g++-5 + # Misc + - python-yaml + - lcov + - libopencv-dev + sources: &xenial_intel_latest_boost_sources + - ubuntu-toolchain-r-test + env: + - OPENCL_LIB=intel + - BOOST_VERSION="1_67_0" + - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=201" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" + # GCC + - os: linux + dist: xenial + compiler: gcc + cache: + ccache: true + directories: + - ${DEPS_DIR}/boost + addons: + apt: + packages: *xenial_intel_latest_boost_packages + sources: *xenial_intel_latest_boost_sources + env: + - OPENCL_LIB=intel + - BOOST_VERSION="1_67_0" + - COVERAGE=true + - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=201" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_ENABLE_COVERAGE=ON -DBOOST_COMPUTE_USE_CPP11=ON" + - COVERAGE=true ############################################################################ # OSX @@ -215,6 +312,8 @@ install: mkdir -p ${DEPS_DIR}/boost rm -rf ${DEPS_DIR}/boost/* # Download + BOOST_BASENAME=$(echo ${BOOST_VERSION} | awk -F '_' '{print $1 "." $2 "." $3 }') + BOOST_URL="https://dl.bintray.com/boostorg/release/${BOOST_BASENAME}/source/boost_${BOOST_VERSION}.tar.gz" travis_retry wget --no-check-certificate --quiet -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/boost${BOOST_VERSION} pushd ${DEPS_DIR}/boost${BOOST_VERSION} # Configure and install @@ -261,6 +360,21 @@ install: fi fi + ############################################################################ + # Install Intel OpenCL Runtime + ############################################################################ + - | + if [[ ${TRAVIS_OS_NAME} == "linux" && ${OPENCL_LIB} == "intel" ]]; then + # https://software.intel.com/en-us/articles/opencl-drivers#cpu-section + PACKAGE_URL=http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/13793/l_opencl_p_18.1.0.013.tgz + PACKAGE_NAME=l_opencl_p_18.1.0.013 + + wget -q ${PACKAGE_URL} -O /tmp/opencl_runtime.tgz + tar -xzf /tmp/opencl_runtime.tgz -C /tmp + sed 's/decline/accept/g' -i /tmp/${PACKAGE_NAME}/silent.cfg + sudo /tmp/${PACKAGE_NAME}/install.sh -s /tmp/${PACKAGE_NAME}/silent.cfg + fi + script: ############################################################################ # Build Boost.Compute tests, benchmarks and examples @@ -285,4 +399,4 @@ after_success: lcov --directory test --base-directory ../include/boost/compute/ --capture --output-file coverage.info lcov --remove coverage.info '/usr*' '*/test/*' '*/deps/*' -o coverage.info cd .. && coveralls-lcov build/coverage.info - fi + fi \ No newline at end of file From 030bc9f31821929c3697e191e774aa7be6f5ef2d Mon Sep 17 00:00:00 2001 From: Jakub Szuppe Date: Thu, 27 Dec 2018 17:38:35 +0100 Subject: [PATCH 2/5] Build with OpenCL 2.2 headers --- .travis.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.travis.yml b/.travis.yml index 377749a6d..0ef566179 100644 --- a/.travis.yml +++ b/.travis.yml @@ -243,6 +243,42 @@ matrix: - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_ENABLE_COVERAGE=ON -DBOOST_COMPUTE_USE_CPP11=ON" - COVERAGE=true + ############################################################################ + # OpenCL 2.2 Only Build + ############################################################################ + + # Linux, OpenCL 2.2, Tests not run, C++11 + # CLANG + - os: linux + dist: xenial + compiler: clang + addons: + apt: + packages: &xenial_packages + - g++-5 + # Misc + - libopencv-dev + sources: &xenial_packages + - ubuntu-toolchain-r-test + env: + - OPENCL_LIB=khronos-icd + - RUN_TESTS=false + - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=202" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" + # GCC + - os: linux + dist: xenial + compiler: gcc + addons: + apt: + packages: *xenial_packages + sources: *xenial_packages + env: + - OPENCL_LIB=khronos-icd + - RUN_TESTS=false + - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=201" + - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" + ############################################################################ # OSX ############################################################################ @@ -342,6 +378,28 @@ install: popd fi + ############################################################################ + # Only ICD + ############################################################################ + - | + if [[ ${TRAVIS_OS_NAME} == "linux" && ${OPENCL_LIB} == "khronos-icd" ]]; then + mkdir -p ${OPENCL_ROOT} + pushd ${OPENCL_ROOT} + travis_retry git clone --depth 1 https://github.com/KhronosGroup/OpenCL-ICD-Loader.git + mv ./OpenCL-ICD-Loader/* . + mkdir -p inc/CL + pushd inc/CL + cp ${OPENCL_ROOT}/include/CL/* . + popd + mkdir -p lib + pushd lib + cmake -G "Unix Makefiles" .. + make + cp ./bin/libOpenCL.so . + popd + popd + fi + ############################################################################ # Build and install POCL https://github.com/pocl/pocl ############################################################################ From 38093e73e0eae29a9a7adffe6a5c417354ba5bd9 Mon Sep 17 00:00:00 2001 From: Jakub Szuppe Date: Fri, 28 Dec 2018 11:07:16 +0100 Subject: [PATCH 3/5] Minor Travis CI fixes --- .travis.yml | 77 ++++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ef566179..3ee0fdc17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ env: # Khronos OpenCL ICD - OPENCL_REGISTRY=https://www.khronos.org/registry/OpenCL/ - OPENCL_ROOT=${DEPS_DIR}/opencl + - OPENCL_ICD_LIB=${OPENCL_ROOT}/icd/build/lib/libOpenCL.so # POCL - POCL_BRANCH=release_1_2 # branch/tag - POCL_LLVM_VERSION=7.0.0 @@ -19,7 +20,7 @@ env: - POCL_C_COMPILER=${DEPS_DIR}/llvm-${POCL_LLVM_VERSION}/bin/clang - POCL_OPENCL_LIB=${POCL_ROOT}/lib/libOpenCL.so # Global build options and C++ flags - - GCC_VERSION=5 + - GCC_VERSION=5 - CMAKE_OPTIONS="-DBOOST_COMPUTE_BUILD_TESTS=ON -DBOOST_COMPUTE_BUILD_EXAMPLES=ON -DBOOST_COMPUTE_BUILD_BENCHMARKS=ON -DBOOST_COMPUTE_USE_OFFLINE_CACHE=ON -DBOOST_COMPUTE_HAVE_OPENCV=ON -DBOOST_COMPUTE_THREAD_SAFE=ON" - CXX_FLAGS="-Wall -pedantic -Werror -Wno-variadic-macros -Wno-long-long -Wno-shadow -DCI_BUILD" # Boost @@ -156,7 +157,7 @@ matrix: - python-yaml - lcov - libopencv-dev - sources: &xenial_intel_packages + sources: &xenial_intel_sources - ubuntu-toolchain-r-test env: - OPENCL_LIB=intel @@ -169,7 +170,7 @@ matrix: addons: apt: packages: *xenial_intel_packages - sources: *xenial_intel_packages + sources: *xenial_intel_sources env: - OPENCL_LIB=intel - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102" @@ -182,7 +183,7 @@ matrix: addons: apt: packages: *xenial_intel_packages - sources: *xenial_intel_packages + sources: *xenial_intel_sources env: - OPENCL_LIB=intel - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=200" @@ -194,7 +195,7 @@ matrix: addons: apt: packages: *xenial_intel_packages - sources: *xenial_intel_packages + sources: *xenial_intel_sources env: - OPENCL_LIB=intel - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=200" @@ -221,7 +222,7 @@ matrix: env: - OPENCL_LIB=intel - BOOST_VERSION="1_67_0" - - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=201" + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=201" - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" # GCC - os: linux @@ -239,7 +240,7 @@ matrix: - OPENCL_LIB=intel - BOOST_VERSION="1_67_0" - COVERAGE=true - - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=201" + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=201" - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_ENABLE_COVERAGE=ON -DBOOST_COMPUTE_USE_CPP11=ON" - COVERAGE=true @@ -256,15 +257,24 @@ matrix: apt: packages: &xenial_packages - g++-5 + # Boost + - libboost-chrono1.58-dev + - libboost-date-time1.58-dev + - libboost-test1.58-dev + - libboost-system1.58-dev + - libboost-filesystem1.58-dev + - libboost-timer1.58-dev + - libboost-program-options1.58-dev + - libboost-thread1.58-dev # Misc - libopencv-dev - sources: &xenial_packages + sources: &xenial_sources - ubuntu-toolchain-r-test env: - OPENCL_LIB=khronos-icd - RUN_TESTS=false - - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=202" - - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=202" + - ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ICD_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" # GCC - os: linux dist: xenial @@ -272,12 +282,12 @@ matrix: addons: apt: packages: *xenial_packages - sources: *xenial_packages + sources: *xenial_sources env: - OPENCL_LIB=khronos-icd - RUN_TESTS=false - - ENV_CXX_FLAGS="-DBOOST_COMPUTE_MAX_CL_VERSION=201" - - ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" + - ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=202" + - ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ICD_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON" ############################################################################ # OSX @@ -327,7 +337,7 @@ before_install: install: ############################################################################ - # Download and install recent CMake + # Download and install recent CMake ############################################################################ - | if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then @@ -338,7 +348,7 @@ install: fi ############################################################################ - # Download and install Boost + # Download and install Boost ############################################################################ - | if [[ ${TRAVIS_OS_NAME} == "linux" && ${BOOST_VERSION} != "default" ]]; then @@ -378,27 +388,21 @@ install: popd fi - ############################################################################ + ############################################################################ # Only ICD - ############################################################################ - - | - if [[ ${TRAVIS_OS_NAME} == "linux" && ${OPENCL_LIB} == "khronos-icd" ]]; then - mkdir -p ${OPENCL_ROOT} - pushd ${OPENCL_ROOT} - travis_retry git clone --depth 1 https://github.com/KhronosGroup/OpenCL-ICD-Loader.git - mv ./OpenCL-ICD-Loader/* . - mkdir -p inc/CL - pushd inc/CL - cp ${OPENCL_ROOT}/include/CL/* . - popd - mkdir -p lib - pushd lib - cmake -G "Unix Makefiles" .. - make - cp ./bin/libOpenCL.so . - popd - popd - fi + ############################################################################ + - | + if [[ ${TRAVIS_OS_NAME} == "linux" && ${OPENCL_LIB} == "khronos-icd" ]]; then + mkdir -p ${OPENCL_ROOT} + pushd ${OPENCL_ROOT} + travis_retry git clone --depth 1 https://github.com/KhronosGroup/OpenCL-ICD-Loader.git icd + pushd icd + mkdir -p inc/CL + cp ${OPENCL_ROOT}/include/CL/* ./inc/CL/ + make -j2 + popd + popd + fi ############################################################################ # Build and install POCL https://github.com/pocl/pocl @@ -411,7 +415,7 @@ install: mkdir build cd build cmake -DDIRECT_LINKAGE=ON -DENABLE_ICD=OFF -DCMAKE_C_COMPILER=${POCL_C_COMPILER} -DCMAKE_CXX_COMPILER=${POCL_CXX_COMPILER} -DWITH_LLVM_CONFIG=${POCL_LLVM_CONFIG} -DCMAKE_INSTALL_PREFIX=${POCL_ROOT}/ .. - make install + make -j2 install cd ../.. else echo 'Using cached POCL lib.' @@ -426,7 +430,6 @@ install: # https://software.intel.com/en-us/articles/opencl-drivers#cpu-section PACKAGE_URL=http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/13793/l_opencl_p_18.1.0.013.tgz PACKAGE_NAME=l_opencl_p_18.1.0.013 - wget -q ${PACKAGE_URL} -O /tmp/opencl_runtime.tgz tar -xzf /tmp/opencl_runtime.tgz -C /tmp sed 's/decline/accept/g' -i /tmp/${PACKAGE_NAME}/silent.cfg From 6fbfa0f67969c357a3195dd64700050448f27148 Mon Sep 17 00:00:00 2001 From: Jakub Szuppe Date: Fri, 28 Dec 2018 11:46:36 +0100 Subject: [PATCH 4/5] Disable warning about deprecated CL extension --- include/boost/compute/kernel.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/compute/kernel.hpp b/include/boost/compute/kernel.hpp index 25e15bd17..48aecca92 100644 --- a/include/boost/compute/kernel.hpp +++ b/include/boost/compute/kernel.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -256,12 +257,14 @@ class kernel return boost::optional(); } + BOOST_COMPUTE_DISABLE_DEPRECATED_DECLARATIONS(); clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR_fptr = reinterpret_cast( reinterpret_cast( device.platform().get_extension_function_address("clGetKernelSubGroupInfoKHR") ) ); + BOOST_COMPUTE_ENABLE_DEPRECATED_DECLARATIONS(); return detail::get_object_info( clGetKernelSubGroupInfoKHR_fptr, m_kernel, info, device.id(), input_size, input @@ -299,12 +302,14 @@ class kernel return boost::optional(); } + BOOST_COMPUTE_DISABLE_DEPRECATED_DECLARATIONS(); clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR_fptr = reinterpret_cast( reinterpret_cast( device.platform().get_extension_function_address("clGetKernelSubGroupInfoKHR") ) ); + BOOST_COMPUTE_ENABLE_DEPRECATED_DECLARATIONS(); return detail::get_object_info( clGetKernelSubGroupInfoKHR_fptr, m_kernel, info, device.id(), input_size, input From facbfb2698b837bb99de3bd0b89efa5d9a967ecb Mon Sep 17 00:00:00 2001 From: Jakub Szuppe Date: Fri, 28 Dec 2018 23:11:33 +0100 Subject: [PATCH 5/5] Fix test_kernel.cpp Also minor fixes for CMake scripts. --- test/CMakeLists.txt | 4 ++-- test/extra/CMakeLists.txt | 4 ++-- test/test_kernel.cpp | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a0ca0cf1b..1aa99ff90 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -46,7 +46,7 @@ endif() add_definitions(-DBOOST_COMPUTE_DEBUG_KERNEL_COMPILATION) # enable code coverage generation (only with GCC for now) -if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") add_definitions(-fprofile-arcs -ftest-coverage) endif() @@ -62,7 +62,7 @@ function(add_compute_test TEST_NAME TEST_SOURCE) ) # link with coverage library - if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") target_link_libraries(${TEST_TARGET} -fprofile-arcs -ftest-coverage) endif() diff --git a/test/extra/CMakeLists.txt b/test/extra/CMakeLists.txt index 2fb58a284..4795a6cc1 100644 --- a/test/extra/CMakeLists.txt +++ b/test/extra/CMakeLists.txt @@ -1,6 +1,6 @@ # --------------------------------------------------------------------------- # Copyright (c) 2015 Kyle Lutz -# +# # Distributed under the Boost Software License, Version 1.0 # See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt @@ -20,7 +20,7 @@ target_link_libraries(test_multiple_objects ${Boost_LIBRARIES} ) # link with coverage library -if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") target_link_libraries(test_multiple_objects -fprofile-arcs -ftest-coverage) endif() add_test("misc.multiple_objects" test_multiple_objects) diff --git a/test/test_kernel.cpp b/test/test_kernel.cpp index 3a9930096..3fda8b174 100644 --- a/test/test_kernel.cpp +++ b/test/test_kernel.cpp @@ -177,11 +177,14 @@ BOOST_AUTO_TEST_CASE(get_sub_group_info_ext) local_work_size ); + #ifdef BOOST_COMPUTE_CL_VERSION_2_1 if(device.check_version(2, 1)) { BOOST_CHECK(count); } - else if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups")) + else + #endif // BOOST_COMPUTE_CL_VERSION_2_1 + if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups")) { // for device with cl_khr_subgroups it should return some value BOOST_CHECK(count); @@ -200,11 +203,14 @@ BOOST_AUTO_TEST_CASE(get_sub_group_info_ext) &local_work_size[0] ); + #ifdef BOOST_COMPUTE_CL_VERSION_2_1 if(device.check_version(2, 1)) { BOOST_CHECK(count); } - else if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups")) + else + #endif // BOOST_COMPUTE_CL_VERSION_2_1 + if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups")) { // for device with cl_khr_subgroups it should return some value BOOST_CHECK(count);