Skip to content

Commit 8f6f1df

Browse files
committed
Merge branch 'develop' into ci-fixes
2 parents bc98019 + 2135633 commit 8f6f1df

File tree

6 files changed

+85
-31
lines changed

6 files changed

+85
-31
lines changed

.appveyor.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
environment:
33
global:
44
BOOST_COMPUTE_DEFAULT_PLATFORM: Intel(R) OpenCL
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
6-
-DBOOST_COMPUTE_THREAD_SAFE=ON
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
76
CXXFLAGS: -DBOOST_COMPUTE_MAX_CL_VERSION=201
87
matrix:
98
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1804
@@ -30,8 +29,7 @@ environment:
3029
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
3130
CMAKE_GENERATOR: Visual Studio 12 2013 Win64
3231
BOOST_ROOT: C:\Libraries\boost_1_58_0
33-
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=OFF
34-
-DBOOST_COMPUTE_THREAD_SAFE=ON
32+
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=OFF -DBOOST_COMPUTE_THREAD_SAFE=ON
3533

3634
install:
3735
# Install OpenCV
@@ -50,26 +48,26 @@ install:
5048
build_script:
5149
- sh: clinfo
5250
- sh: echo ${CMAKE_OPTIONS}
53-
- sh: echo ${CXX_FLAGS}
51+
- sh: echo ${CXXFLAGS}
5452
- sh: echo ${CMAKE_GENERATOR}
5553
- sh: echo ${CC}
5654
- sh: echo ${CXX}
5755
- cmd: .\clinfo.exe
5856
- cmd: echo %CMAKE_OPTIONS%
59-
- cmd: echo %CXX_FLAGS%
57+
- cmd: echo %CXXFLAGS%
6058
- cmd: echo %CMAKE_GENERATOR%
6159
- cmd: echo %CC%
6260
- cmd: echo %CXX%
6361
- mkdir build && cd build
6462
- cmd: cmake -G"%CMAKE_GENERATOR%" %CMAKE_OPTIONS% ..
6563
- sh: cmake -G"${CMAKE_GENERATOR}" ${CMAKE_OPTIONS} ..
66-
- cmake --build . --config Debug -j 4
64+
- cmake --build . --config Debug -j 2
6765

6866
test_script:
6967
- cmd: .\example\Debug\list_devices.exe
7068
- cmd: .\example\Debug\hello_world.exe
71-
- sh: ./example/Debug/list_devices
72-
- sh: ./example/Debug/hello_world
69+
- sh: ./example/list_devices
70+
- sh: ./example/hello_world
7371
- ctest --output-on-failure --repeat-until-fail 2
7472

7573
for:

.travis.yml

+61-16
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
# Khronos OpenCL ICD
1212
- OPENCL_REGISTRY=https://www.khronos.org/registry/OpenCL/
1313
- OPENCL_ROOT=${DEPS_DIR}/opencl
14+
- OPENCL_ICD_LIB=${OPENCL_ROOT}/icd/build/lib/libOpenCL.so
1415
# POCL
1516
- POCL_BRANCH=release_1_2 # branch/tag
1617
- POCL_LLVM_VERSION=7.0.0
@@ -96,7 +97,7 @@ matrix:
9697
- OPENCL_LIB=pocl
9798
- ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=101"
9899
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${POCL_OPENCL_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
99-
# Linux, OpenCL 1.2
100+
# Xenial, OpenCL 1.2
100101
# CLANG
101102
- os: linux
102103
compiler: clang
@@ -119,10 +120,10 @@ matrix:
119120
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${POCL_OPENCL_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
120121

121122
############################################################################
122-
# Intel OpenCL Runtime builds
123+
# Intel OpenCL Runtime builds (1.2, 2.0, 2.1)
123124
############################################################################
124125

125-
# Linux, Intel OpenCL 1.2
126+
# Xenial, Intel OpenCL 1.2
126127
# CLANG
127128
- os: linux
128129
compiler: clang
@@ -143,7 +144,7 @@ matrix:
143144
- OPENCL_LIB=intel
144145
- ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=102"
145146
- ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
146-
# Linux, Intel OpenCL 2.0
147+
# Xenial, Intel OpenCL 2.0
147148
# CLANG
148149
- os: linux
149150
compiler: clang
@@ -164,7 +165,7 @@ matrix:
164165
- OPENCL_LIB=intel
165166
- ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=200"
166167
- ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include"
167-
# Linux, Intel OpenCL 2.1
168+
# Xenial, Intel OpenCL 2.1, New Boost Libs, C++11, Coverage
168169
# CLANG
169170
- os: linux
170171
compiler: clang
@@ -202,6 +203,36 @@ matrix:
202203
- ENV_CMAKE_OPTIONS="-DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_ENABLE_COVERAGE=ON -DBOOST_COMPUTE_USE_CPP11=ON"
203204
- COVERAGE=true
204205

206+
############################################################################
207+
# OpenCL 2.2 Only Build
208+
############################################################################
209+
210+
# Linux, OpenCL 2.2, Tests not run, C++11
211+
# CLANG
212+
- os: linux
213+
dist: xenial
214+
compiler: clang
215+
addons:
216+
apt:
217+
packages: *xenial_packages
218+
env:
219+
- OPENCL_LIB=khronos-icd
220+
- RUN_TESTS=false
221+
- ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=202"
222+
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ICD_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON"
223+
# GCC
224+
- os: linux
225+
dist: xenial
226+
compiler: gcc
227+
addons:
228+
apt:
229+
packages: *xenial_packages
230+
env:
231+
- OPENCL_LIB=khronos-icd
232+
- RUN_TESTS=false
233+
- ENV_CXX_FLAGS="-Wno-unused-local-typedef -DBOOST_COMPUTE_MAX_CL_VERSION=202"
234+
- ENV_CMAKE_OPTIONS="-DOpenCL_LIBRARY=${OPENCL_ICD_LIB} -DOpenCL_INCLUDE_DIR=${OPENCL_ROOT}/include -DBOOST_COMPUTE_USE_CPP11=ON"
235+
205236
############################################################################
206237
# OSX
207238
############################################################################
@@ -267,7 +298,7 @@ matrix:
267298
# Download clinfo executable and add it to PATH
268299
- mkdir bin
269300
- curl -L 'https://ci.appveyor.com/api/projects/oblomov/clinfo/artifacts/clinfo.exe?job=platform:+x64' -o ./bin/clinfo.exe
270-
- export PATH=./bin/:PATH
301+
- export PATH=./bin/:$PATH
271302

272303
cache:
273304
directories:
@@ -289,16 +320,12 @@ before_install:
289320
fi
290321
fi
291322
- gem install coveralls-lcov
292-
293-
# Combine global build options with OS/compiler-dependent options
294-
- export CMAKE_OPTIONS=${CMAKE_OPTIONS}" "${ENV_CMAKE_OPTIONS}
295-
- export CXXFLAGS=${CXX_FLAGS}" "${ENV_CXX_FLAGS}
296323
# Pick correct compiler on OSX
297324
- eval "${MATRIX_EVAL}"
298325

299326
install:
300327
############################################################################
301-
# Download and install recent CMake
328+
# Download and install recent CMake
302329
############################################################################
303330
- |
304331
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
@@ -309,7 +336,7 @@ install:
309336
fi
310337
311338
############################################################################
312-
# Download and install Boost
339+
# Download and install Boost
313340
############################################################################
314341
- |
315342
if [[ ${TRAVIS_OS_NAME} == "linux" && ${BOOST_VERSION} != "default" ]]; then
@@ -348,6 +375,22 @@ install:
348375
popd
349376
fi
350377
378+
############################################################################
379+
# Only ICD
380+
############################################################################
381+
- |
382+
if [[ ${TRAVIS_OS_NAME} == "linux" && ${OPENCL_LIB} == "khronos-icd" ]]; then
383+
mkdir -p ${OPENCL_ROOT}
384+
pushd ${OPENCL_ROOT}
385+
travis_retry git clone --depth 1 https://github.com/KhronosGroup/OpenCL-ICD-Loader.git icd
386+
pushd icd
387+
mkdir -p inc/CL
388+
cp ${OPENCL_ROOT}/include/CL/* ./inc/CL/
389+
make -j2
390+
popd
391+
popd
392+
fi
393+
351394
############################################################################
352395
# Build and install POCL https://github.com/pocl/pocl
353396
############################################################################
@@ -359,7 +402,7 @@ install:
359402
mkdir build
360403
cd build
361404
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}/ ..
362-
make install
405+
make -j2 install
363406
cd ../..
364407
else
365408
echo 'Using cached POCL lib.'
@@ -385,8 +428,10 @@ script:
385428
# Build Boost.Compute tests, benchmarks and examples
386429
############################################################################
387430
- clinfo
388-
- mkdir -p build
389-
- cd build
431+
- mkdir build && cd build
432+
# Combine global build options with OS/compiler-dependent options
433+
- export CMAKE_OPTIONS=${CMAKE_OPTIONS}" "${ENV_CMAKE_OPTIONS}
434+
- export CXXFLAGS=${CXX_FLAGS}" "${ENV_CXX_FLAGS}
390435
- echo ${CXXFLAGS}
391436
- echo ${CXX}
392437
- echo ${CCFLAGS}
@@ -397,7 +442,7 @@ script:
397442
# https://stackoverflow.com/questions/39865367/warning-section-textcoal-nt-is-deprecate-since-updating-to-mac-osx-sierra
398443
# Build must be run sequentially or else the grep command will not catch warnings correctly
399444
- if [[ ${TRAVIS_OS_NAME} == "osx" && ${CC} == "gcc-5" ]]; then cmake --build . --config Debug 2>&1 | grep -v -e '^/var/folders/*' -e '^[[:space:]]*\.section' -e '^[[:space:]]*\^[[:space:]]*~*' ; fi
400-
- if [[ ${TRAVIS_OS_NAME} != "osx" || ${CC} != "gcc-5" ]]; then cmake --build . -j 4 --config Debug ; fi
445+
- if [[ ${TRAVIS_OS_NAME} != "osx" || ${CC} != "gcc-5" ]]; then cmake --build . -j 2 --config Debug ; fi
401446
- |
402447
if [[ ${RUN_TESTS} == "true" ]]; then
403448
# Print OpenCL devices

include/boost/compute/kernel.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <boost/compute/program.hpp>
2525
#include <boost/compute/platform.hpp>
2626
#include <boost/compute/type_traits/is_fundamental.hpp>
27+
#include <boost/compute/detail/diagnostic.hpp>
2728
#include <boost/compute/detail/get_object_info.hpp>
2829
#include <boost/compute/detail/assert_cl_success.hpp>
2930

@@ -256,12 +257,14 @@ class kernel
256257
return boost::optional<T>();
257258
}
258259

260+
BOOST_COMPUTE_DISABLE_DEPRECATED_DECLARATIONS();
259261
clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR_fptr =
260262
reinterpret_cast<clGetKernelSubGroupInfoKHR_fn>(
261263
reinterpret_cast<size_t>(
262264
device.platform().get_extension_function_address("clGetKernelSubGroupInfoKHR")
263265
)
264266
);
267+
BOOST_COMPUTE_ENABLE_DEPRECATED_DECLARATIONS();
265268

266269
return detail::get_object_info<T>(
267270
clGetKernelSubGroupInfoKHR_fptr, m_kernel, info, device.id(), input_size, input
@@ -299,12 +302,14 @@ class kernel
299302
return boost::optional<T>();
300303
}
301304

305+
BOOST_COMPUTE_DISABLE_DEPRECATED_DECLARATIONS();
302306
clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR_fptr =
303307
reinterpret_cast<clGetKernelSubGroupInfoKHR_fn>(
304308
reinterpret_cast<size_t>(
305309
device.platform().get_extension_function_address("clGetKernelSubGroupInfoKHR")
306310
)
307311
);
312+
BOOST_COMPUTE_ENABLE_DEPRECATED_DECLARATIONS();
308313

309314
return detail::get_object_info<T>(
310315
clGetKernelSubGroupInfoKHR_fptr, m_kernel, info, device.id(), input_size, input

test/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ endif()
4646
add_definitions(-DBOOST_COMPUTE_DEBUG_KERNEL_COMPILATION)
4747

4848
# enable code coverage generation (only with GCC for now)
49-
if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
49+
if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
5050
add_definitions(-fprofile-arcs -ftest-coverage)
5151
endif()
5252

@@ -62,7 +62,7 @@ function(add_compute_test TEST_NAME TEST_SOURCE)
6262
)
6363

6464
# link with coverage library
65-
if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
65+
if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
6666
target_link_libraries(${TEST_TARGET} -fprofile-arcs -ftest-coverage)
6767
endif()
6868

test/extra/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ---------------------------------------------------------------------------
22
# Copyright (c) 2015 Kyle Lutz <[email protected]>
3-
#
3+
#
44
# Distributed under the Boost Software License, Version 1.0
55
# See accompanying file LICENSE_1_0.txt or copy at
66
# http://www.boost.org/LICENSE_1_0.txt
@@ -20,7 +20,7 @@ target_link_libraries(test_multiple_objects
2020
${Boost_LIBRARIES}
2121
)
2222
# link with coverage library
23-
if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
23+
if(${BOOST_COMPUTE_ENABLE_COVERAGE} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
2424
target_link_libraries(test_multiple_objects -fprofile-arcs -ftest-coverage)
2525
endif()
2626
add_test("misc.multiple_objects" test_multiple_objects)

test/test_kernel.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,14 @@ BOOST_AUTO_TEST_CASE(get_sub_group_info_ext)
177177
local_work_size
178178
);
179179

180+
#ifdef BOOST_COMPUTE_CL_VERSION_2_1
180181
if(device.check_version(2, 1))
181182
{
182183
BOOST_CHECK(count);
183184
}
184-
else if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups"))
185+
else
186+
#endif // BOOST_COMPUTE_CL_VERSION_2_1
187+
if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups"))
185188
{
186189
// for device with cl_khr_subgroups it should return some value
187190
BOOST_CHECK(count);
@@ -200,11 +203,14 @@ BOOST_AUTO_TEST_CASE(get_sub_group_info_ext)
200203
&local_work_size[0]
201204
);
202205

206+
#ifdef BOOST_COMPUTE_CL_VERSION_2_1
203207
if(device.check_version(2, 1))
204208
{
205209
BOOST_CHECK(count);
206210
}
207-
else if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups"))
211+
else
212+
#endif // BOOST_COMPUTE_CL_VERSION_2_1
213+
if(device.check_version(2, 0) && device.supports_extension("cl_khr_subgroups"))
208214
{
209215
// for device with cl_khr_subgroups it should return some value
210216
BOOST_CHECK(count);

0 commit comments

Comments
 (0)