Permalink
Browse files

Replace BOOST_VERIFY by ALPAKA_CHECK and return success from all test…

… kernels
  • Loading branch information...
BenjaminW3 committed Aug 25, 2018
1 parent 5b13067 commit 263507571fa02949792e494a5070cc08fc8960ac
Showing with 436 additions and 311 deletions.
  1. +1 −1 .appveyor.yml
  2. +14 −4 .travis.yml
  3. +1 −1 example/helloWorldLambda/src/helloWorldLambda.cpp
  4. +12 −0 script/travis/print_travisEnv.sh
  5. +2 −0 test/common/include/alpaka/test/Array.hpp
  6. +31 −0 test/common/include/alpaka/test/Check.hpp
  7. +17 −1 test/common/include/alpaka/test/KernelExecutionFixture.hpp
  8. +8 −34 test/common/include/alpaka/test/acc/Acc.hpp
  9. +2 −2 test/common/include/alpaka/test/mem/view/Iterator.hpp
  10. +49 −57 test/common/include/alpaka/test/mem/view/ViewTest.hpp
  11. +6 −1 test/integ/cudaOnly/src/cudaNativeFunctions.cpp
  12. +25 −25 test/unit/atomic/src/AtomicTest.cpp
  13. +8 −6 test/unit/block/shared/src/BlockSharedMemDyn.cpp
  14. +23 −22 test/unit/block/shared/src/BlockSharedMemSt.cpp
  15. +6 −4 test/unit/block/sync/src/BlockSync.cpp
  16. +10 −10 test/unit/block/sync/src/BlockSyncPredicate.cpp
  17. +118 −0 test/unit/kernel/src/KernelGenericLambda.cpp
  18. +25 −79 test/unit/kernel/src/KernelLambda.cpp
  19. +3 −4 test/unit/kernel/src/KernelWithAdditionalParam.cpp
  20. +4 −4 test/unit/kernel/src/KernelWithConstructorAndMember.cpp
  21. +13 −12 test/unit/kernel/src/KernelWithHostConstexpr.cpp
  22. +15 −7 test/unit/kernel/src/KernelWithTemplate.cpp
  23. +20 −12 test/unit/kernel/src/KernelWithoutTemplatedAccParam.cpp
  24. +1 −5 test/unit/mem/p2p/src/P2P.cpp
  25. +1 −1 test/unit/mem/view/CMakeLists.txt
  26. +3 −2 test/unit/mem/view/src/ViewStaticAccMem.cpp
  27. +13 −12 test/unit/rand/src/RandTest.cpp
  28. +5 −5 test/unit/time/src/ClockTest.cpp
View
@@ -141,7 +141,7 @@ before_build:
- cmd: if not "%ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE%"=="OFF" set ALPAKA_BOOST_B2=%ALPAKA_BOOST_B2% --with-fiber --with-context --with-thread --with-system --with-atomic --with-chrono --with-date_time
- cmd: if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" set ALPAKA_BOOST_TOOLSET=msvc-14.1
- cmd: b2 -j2 --toolset=%ALPAKA_BOOST_TOOLSET% --layout=versioned %ALPAKA_BOOST_B2% architecture=x86 address-model=%ALPAKA_BOOST_ADDRESS_MODEL% variant=%ALPAKA_BOOST_VARIANT% link=static threading=multi runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECAT define=BOOST_USE_WINFIBERS --stagedir="%ALPAKA_B2_STAGE_DIR%"
- cmd: b2 -j2 --toolset=%ALPAKA_BOOST_TOOLSET% --layout=versioned %ALPAKA_BOOST_B2% architecture=x86 address-model=%ALPAKA_BOOST_ADDRESS_MODEL% variant=%ALPAKA_BOOST_VARIANT% link=static threading=multi runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECAT define=BOOST_USE_WINFIBERS define=_ENABLE_EXTENDED_ALIGNED_STORAGE --stagedir="%ALPAKA_B2_STAGE_DIR%"
#-------------------------------------------------------------------------------
# Install TBB
View
@@ -89,9 +89,9 @@ matrix:
# gcc 6 ASan is triggered within libtbb.so
# gcc 7 ASan introduced 'stack-use-after-scope' which is triggered by GOMP_parallel
- name: gcc-4.9 Debug
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.66.0 ALPAKA_CI_CMAKE_VER=3.7.2 ALPAKA_CI_SANITIZERS= OMP_NUM_THREADS=4
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.62.0 ALPAKA_CI_CMAKE_VER=3.7.2 ALPAKA_CI_SANITIZERS= OMP_NUM_THREADS=4
- name: gcc-5 Release
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.62.0 ALPAKA_CI_CMAKE_VER=3.10.3 ALPAKA_CI_SANITIZERS= OMP_NUM_THREADS=3
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.66.0 ALPAKA_CI_CMAKE_VER=3.10.3 ALPAKA_CI_SANITIZERS= OMP_NUM_THREADS=3
- name: gcc-6 Debug
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:17.10 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=6 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.9.6 ALPAKA_CI_SANITIZERS= OMP_NUM_THREADS=2
- name: gcc-7 Release
@@ -100,11 +100,11 @@ matrix:
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=8 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.12.0 ALPAKA_CI_SANITIZERS= OMP_NUM_THREADS=4
# clang++
- name: clang-4 Debug
- name: clang-4 Debug UBSan
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.64.0 ALPAKA_CI_CMAKE_VER=3.7.2 ALPAKA_CI_SANITIZERS=UBSan OMP_NUM_THREADS=4
- name: clang-5 Debug
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=5.0.2 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_CI_SANITIZERS= OMP_NUM_THREADS=3
- name: clang-6 Release
- name: clang-6 Release ASan
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=6.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.63.0 ALPAKA_CI_CMAKE_VER=3.8.2 ALPAKA_CI_SANITIZERS=ASan OMP_NUM_THREADS=2
## CUDA 8.0
@@ -162,6 +162,10 @@ cache:
- $ALPAKA_CI_DOCKER_CACHE_DIR
script:
- sudo apt-get -y --quiet --allow-unauthenticated --no-install-recommends install smem
- sudo smem
- sudo free -m -t
- ./script/travis/print_travisEnv.sh
- sudo apt-get -y --quiet install moreutils
@@ -170,5 +174,11 @@ script:
- ./script/travis/docker_install.sh | ts
- ./script/travis/docker_run.sh | ts
after_failure:
- sudo smem
- sudo free -m -t
# show actions of the OOM killer
- sudo dmesg
notifications:
email: false
@@ -47,7 +47,7 @@ void ALPAKA_FN_ACC hiWorldFunction(
Vec const globalThreadExtent = alpaka::workdiv::getWorkDiv<alpaka::Grid, alpaka::Threads>(acc);
Vec1 const linearizedGlobalThreadIdx = alpaka::idx::mapIdx<1u>(globalThreadIdx,
globalThreadExtent);
printf("[z:%u, y:%u, x:%u][linear:%u] Hi world from a function",
static_cast<unsigned>(globalThreadIdx[0]),
static_cast<unsigned>(globalThreadIdx[1]),
@@ -39,3 +39,15 @@ echo TRAVIS_SECURE_ENV_VARS: "${TRAVIS_SECURE_ENV_VARS}"
echo TRAVIS_REPO_SLUG: "${TRAVIS_REPO_SLUG}"
echo TRAVIS_OS_NAME: "${TRAVIS_OS_NAME}"
echo TRAVIS_TAG: "${TRAVIS_TAG}"
# Show all running services
sudo service --status-all
# Stop some unnecessary services to save memory
sudo /etc/init.d/mysql stop
sudo /etc/init.d/postgresql stop
sudo /etc/init.d/redis-server stop
# Show memory stats
sudo smem
sudo free -m -t
@@ -19,6 +19,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
namespace alpaka
{
namespace test
@@ -0,0 +1,31 @@
/**
* \file
* Copyright 2018 Benjamin Worpitz
*
* This file is part of alpaka.
*
* alpaka is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* alpaka is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with alpaka.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <cstdio>
#define ALPAKA_CHECK(success, expression) \
if(!(expression)) \
{ \
printf("ALPAKA_CHECK failed because '!(%s)'\n", #expression); \
success = false; \
}
@@ -20,6 +20,8 @@
*/
#include <alpaka/alpaka.hpp>
#include <alpaka/test/Check.hpp>
#include <alpaka/test/queue/Queue.hpp>
namespace alpaka
@@ -66,15 +68,29 @@ namespace alpaka
TArgs const & ... args)
-> bool
{
// Allocate the result value
auto bufAccResult(alpaka::mem::buf::alloc<bool, Idx>(m_devAcc, static_cast<Idx>(1u)));
alpaka::mem::view::set(
m_queue,
bufAccResult,
static_cast<std::uint8_t>(true),
bufAccResult);
alpaka::kernel::exec<Acc>(
m_queue,
m_workDiv,
kernelFnObj,
alpaka::mem::view::getPtrNative(bufAccResult),
args...);
// Copy the result value to the host
auto bufHostResult(alpaka::mem::buf::alloc<bool, Idx>(m_devHost, static_cast<Idx>(1u)));
alpaka::mem::view::copy(m_queue, bufHostResult, bufAccResult, bufAccResult);
alpaka::wait::wait(m_queue);
return true;
auto const result(*alpaka::mem::view::getPtrNative(bufHostResult));
return result;
}
//-----------------------------------------------------------------------------
virtual ~KernelExecutionFixture()
@@ -202,45 +202,16 @@ namespace alpaka
os << std::endl;
}
#if defined(ALPAKA_CUDA_CI)
//#############################################################################
//! A std::tuple holding dimensions.
using TestDims =
std::tuple<
alpaka::dim::DimInt<1u>,
//alpaka::dim::DimInt<2u>,
alpaka::dim::DimInt<3u>
// The CUDA acceleator does not currently support 4D buffers and 4D acceleration.
#if !(defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && BOOST_LANG_CUDA)
/*,alpaka::dim::DimInt<4u>*/
#endif
>;
//#############################################################################
//! A std::tuple holding idx types.
using TestIdxs =
std::tuple<
std::size_t,
//std::int64_t,
std::uint64_t,
std::int32_t,
//std::uint32_t,
//std::int16_t,
std::uint16_t/*,
// When Idx is a 8 bit integer, extents within the tests would be extremely limited
// (especially when Dim is 4). Therefore, we do not test it.
std::int8_t,
std::uint8_t*/>;
#else
//#############################################################################
//! A std::tuple holding dimensions.
using TestDims =
std::tuple<
alpaka::dim::DimInt<1u>,
#if !defined(ALPAKA_CUDA_CI)
alpaka::dim::DimInt<2u>,
#endif
alpaka::dim::DimInt<3u>
// The CUDA acceleator does not currently support 4D buffers and 4D acceleration.
// The CUDA acceleator does not currently support 4D buffers and 4D acceleration.
#if !(defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && BOOST_LANG_CUDA)
,alpaka::dim::DimInt<4u>
#endif
@@ -253,17 +224,20 @@ namespace alpaka
// size_t is most probably identical to either std::uint64_t or std::uint32_t.
// This would lead to duplicate tests (especially test names) which is not allowed.
//std::size_t,
#if !defined(ALPAKA_CI)
std::int64_t,
#endif
std::uint64_t,
std::int32_t,
#if !defined(ALPAKA_CI)
std::uint32_t,
//std::int16_t,
std::int16_t,
#endif
std::uint16_t/*,
// When Idx is a 8 bit integer, extents within the tests would be extremely limited
// (especially when Dim is 4). Therefore, we do not test it.
std::int8_t,
std::uint8_t*/>;
#endif
namespace detail
{
@@ -229,7 +229,7 @@ namespace alpaka
//-----------------------------------------------------------------------------
template<
typename TView>
ALPAKA_FN_HOST static auto begin(
ALPAKA_FN_HOST auto begin(
TView & view)
-> Iterator<TView>
{
@@ -239,7 +239,7 @@ namespace alpaka
//-----------------------------------------------------------------------------
template<
typename TView>
ALPAKA_FN_HOST static auto end(
ALPAKA_FN_HOST auto end(
TView & view)
-> Iterator<TView>
{
Oops, something went wrong.

0 comments on commit 2635075

Please sign in to comment.