Skip to content

Commit ee42a8c

Browse files
authored
Merge pull request #264 from ComputationalRadiationPhysics/develop
merge develop to master
2 parents baf9b25 + 2e4bff0 commit ee42a8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+390
-68
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Accelerator Back-ends
5050
|OpenMP 4.0+ (CPU)|OpenMP 4.0+|Host CPU (multi core)|parallel (undefined)|parallel (preemptive multitasking)|
5151
| std::thread | std::thread |Host CPU (multi core)|sequential|parallel (preemptive multitasking)|
5252
|CUDA 7.0+|CUDA 7.0+|NVIDIA GPUs SM 2.0+|parallel (undefined)|parallel (lock-step within warps)|
53-
|TBB 2.2+ blocks|TBB 2.2+|Host CPU (multi core)|parallel (preemptive multitasking)|sequential (only 1 thread per block)|
5453

5554

5655
Supported Compilers
@@ -66,7 +65,6 @@ This library uses C++11 (or newer when available).
6665
|OpenMP 4.0+ (CPU)|:white_check_mark:|:white_check_mark:|:white_check_mark:|:x:|:x:|:x:|:x:|
6766
| std::thread |:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|
6867
|CUDA 7.0+|:white_check_mark: (nvcc 7.0+)|:x:|:x:|:x:|:x:|:white_check_mark: (native)|:x:|
69-
|TBB 2.2+|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:grey_question:|
7068

7169

7270
Dependencies
@@ -81,8 +79,6 @@ When an accelerator back-end using *CUDA* is enabled, version *7.0* of the *CUDA
8179

8280
When an accelerator back-end using *OpenMP* is enabled, the compiler and the platform have to support the corresponding minimum *OpenMP* version.
8381

84-
When an accelerator back-end using *TBB* is enabled, the compiler and the platform have to support the corresponding minimum *TBB* version.
85-
8682

8783
Usage
8884
-----

cmake/dev.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2014-2015 Benjamin Worpitz
2+
# Copyright 2014-2016 Benjamin Worpitz
33
#
44
# This file is part of alpaka.
55
#
@@ -24,8 +24,9 @@
2424

2525
#MSVC
2626
IF(MSVC)
27-
# Force to always compile with W4
27+
# Force to always compile with W4 and WX
2828
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "/W4")
29+
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "/WX")
2930
# Improve debugging.
3031
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
3132
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-d2Zi+")
@@ -34,11 +35,15 @@ ELSE()
3435
# GNU
3536
IF(CMAKE_COMPILER_IS_GNUCXX)
3637
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wall")
37-
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-pedantic")
3838
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wextra")
39+
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-pedantic")
40+
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Werror")
3941
# Clang or AppleClang
4042
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
4143
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wall")
44+
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wextra")
45+
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-pedantic")
46+
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Werror")
4247
# ICC
4348
ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
4449
LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wall")

doc/doxygen/Doxyfile

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Doxyfile 1.8.10
1+
# Doxyfile 1.8.11
22

33
# This file describes the settings to be used by the documentation system
44
# doxygen (www.doxygen.org) for a project.
@@ -749,6 +749,12 @@ WARN_IF_DOC_ERROR = YES
749749

750750
WARN_NO_PARAMDOC = YES
751751

752+
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
753+
# a warning is encountered.
754+
# The default value is: NO.
755+
756+
WARN_AS_ERROR = NO
757+
752758
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
753759
# can produce. The string should contain the $file, $line, and $text tags, which
754760
# will be replaced by the file and line number from which the warning originated
@@ -777,9 +783,6 @@ WARN_LOGFILE =
777783

778784
INPUT = ../../include/ \
779785
../../README.md \
780-
../Distinction.md \
781-
../Abstraction.md \
782-
../Threading.md \
783786
../Rationale.md
784787

785788
# This tag can be used to specify the character encoding of the source files
@@ -802,8 +805,8 @@ INPUT_ENCODING = UTF-8
802805
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
803806
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
804807
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
805-
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
806-
# *.vhdl, *.ucf, *.qsf, *.as and *.js.
808+
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
809+
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
807810

808811
FILE_PATTERNS = *.c \
809812
*.cc \
@@ -932,6 +935,10 @@ IMAGE_PATH =
932935
# Note that the filter must not add or remove lines; it is applied before the
933936
# code is scanned, but not when the output code is generated. If lines are added
934937
# or removed, the anchors will not be placed correctly.
938+
#
939+
# Note that for custom extensions or not directly supported extensions you also
940+
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
941+
# properly processed by doxygen.
935942

936943
INPUT_FILTER =
937944

@@ -941,6 +948,10 @@ INPUT_FILTER =
941948
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
942949
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
943950
# patterns match the file name, INPUT_FILTER is applied.
951+
#
952+
# Note that for custom extensions or not directly supported extensions you also
953+
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
954+
# properly processed by doxygen.
944955

945956
FILTER_PATTERNS =
946957

@@ -1058,7 +1069,7 @@ VERBATIM_HEADERS = YES
10581069
# rich C++ code for which doxygen's built-in parser lacks the necessary type
10591070
# information.
10601071
# Note: The availability of this option depends on whether or not doxygen was
1061-
# compiled with the --with-libclang option.
1072+
# generated with the -Duse-libclang=ON option for CMake.
10621073
# The default value is: NO.
10631074

10641075
CLANG_ASSISTED_PARSING = NO
@@ -1802,6 +1813,14 @@ LATEX_SOURCE_CODE = NO
18021813

18031814
LATEX_BIB_STYLE = plain
18041815

1816+
# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
1817+
# page will contain the date and time when the page was generated. Setting this
1818+
# to NO can help when comparing the output of multiple runs.
1819+
# The default value is: NO.
1820+
# This tag requires that the tag GENERATE_LATEX is set to YES.
1821+
1822+
LATEX_TIMESTAMP = NO
1823+
18051824
#---------------------------------------------------------------------------
18061825
# Configuration options related to the RTF output
18071826
#---------------------------------------------------------------------------

example/bufferCopy/src/bufferCopy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ auto main()
169169
/***************************************************************************
170170
* Get the first device
171171
**************************************************************************/
172-
DevAcc devAcc(alpaka::pltf::getDevByIdx<PltfAcc>(0u));
173-
DevHost devHost(alpaka::pltf::getDevByIdx<PltfHost>(0u));
172+
DevAcc const devAcc(alpaka::pltf::getDevByIdx<PltfAcc>(0u));
173+
DevHost const devHost(alpaka::pltf::getDevByIdx<PltfHost>(0u));
174174

175175
/***************************************************************************
176176
* Create sync stream

example/helloWorld/src/helloWorld.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ auto main()
117117
* can also retrieve all devices in a vector (getDevs()).
118118
* In this example the first devices is choosen.
119119
*/
120-
DevAcc devAcc(alpaka::pltf::getDevByIdx<PltfAcc>(0u));
121-
DevHost devHost(alpaka::pltf::getDevByIdx<PltfHost>(0u));
120+
DevAcc const devAcc(alpaka::pltf::getDevByIdx<PltfAcc>(0u));
121+
DevHost const devHost(alpaka::pltf::getDevByIdx<PltfHost>(0u));
122122

123123
/**
124124
* Create a stream to the accelerator device

example/vectorAdd/src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ auto main()
9999
VectorAddKernel kernel;
100100

101101
// Get the host device.
102-
auto devHost(
102+
auto const devHost(
103103
alpaka::pltf::getDevByIdx<PltfHost>(0u));
104104

105105
// Select a device to execute on.
106-
auto devAcc(
106+
auto const devAcc(
107107
alpaka::pltf::getDevByIdx<PltfAcc>(0));
108108

109109
// Get a stream on this device.

include/alpaka/idx/Traits.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#include <alpaka/workdiv/Traits.hpp> // workdiv::getWorkDiv
3535

3636
#include <boost/config.hpp> // BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
37+
#if !BOOST_ARCH_CUDA_DEVICE
38+
#include <boost/core/ignore_unused.hpp> // boost::ignore_unused
39+
#endif
3740

3841
#include <utility> // std::forward
3942

@@ -228,6 +231,9 @@ namespace alpaka
228231
TThreadElemExtent const & threadElemExtent)
229232
-> Vec<dim::Dim<TIdxWorkDiv>, size::Size<TIdxWorkDiv>>
230233
{
234+
#if !BOOST_ARCH_CUDA_DEVICE
235+
boost::ignore_unused(idxWorkDiv);
236+
#endif
231237
return gridThreadIdx * threadElemExtent;
232238
}
233239
//-----------------------------------------------------------------------------

include/alpaka/mem/buf/BufCpu.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737

3838
#include <alpaka/meta/DependentFalseType.hpp> // meta::DependentFalseType
3939

40+
#if !BOOST_ARCH_CUDA_DEVICE
41+
#include <boost/core/ignore_unused.hpp> // boost::ignore_unused
42+
#endif
43+
4044
#include <cassert> // assert
4145
#include <memory> // std::shared_ptr
4246

@@ -638,6 +642,7 @@ namespace alpaka
638642
#if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && BOOST_LANG_CUDA
639643
return bufImpl.m_bPinned;
640644
#else
645+
boost::ignore_unused(bufImpl);
641646
return false;
642647
#endif
643648
}

include/alpaka/mem/view/Traits.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <alpaka/stream/Traits.hpp> // stream::enqueue
3030

3131
#include <alpaka/vec/Vec.hpp> // Vec
32-
3332
#include <alpaka/meta/Fold.hpp> // meta::foldr
3433
#include <alpaka/core/Common.hpp> // ALPAKA_FN_HOST
3534

@@ -566,13 +565,7 @@ namespace alpaka
566565
rowPrefix,
567566
rowSuffix);
568567
}
569-
}
570-
}
571568

572-
namespace mem
573-
{
574-
namespace view
575-
{
576569
namespace detail
577570
{
578571
//#############################################################################

include/alpaka/mem/view/ViewPlainPtr.hpp

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,8 @@ namespace alpaka
5757
m_pMem(pMem),
5858
m_dev(dev),
5959
m_extentElements(extent::getExtentVecEnd<TDim>(extent)),
60-
m_pitchBytes(Vec<TDim, TSize>::all(0))
61-
{
62-
// Calculate the pitches by hand.
63-
m_pitchBytes[TDim::value - 1u] = extent[TDim::value - 1u] * sizeof(TElem);
64-
for(TSize i = TDim::value - 1u; i > static_cast<TSize>(0u); --i)
65-
{
66-
m_pitchBytes[i-1] = extent[i-1] * m_pitchBytes[i];
67-
}
68-
}
60+
m_pitchBytes(calculatePitchesFromExtents(m_extentElements))
61+
{}
6962

7063
//-----------------------------------------------------------------------------
7164
//! Constructor
@@ -116,11 +109,31 @@ namespace alpaka
116109
ALPAKA_NO_HOST_ACC_WARNING
117110
ALPAKA_FN_HOST_ACC ~ViewPlainPtr() = default;
118111

112+
private:
113+
//-----------------------------------------------------------------------------
114+
//! Calculate the pitches purely from the extents.
115+
//-----------------------------------------------------------------------------
116+
ALPAKA_NO_HOST_ACC_WARNING
117+
template<
118+
typename TExtent>
119+
ALPAKA_FN_HOST_ACC static auto calculatePitchesFromExtents(
120+
TExtent const & extent)
121+
-> Vec<TDim, TSize>
122+
{
123+
Vec<TDim, TSize> pitchBytes(Vec<TDim, TSize>::all(0));
124+
pitchBytes[TDim::value - 1u] = extent[TDim::value - 1u] * sizeof(TElem);
125+
for(TSize i = TDim::value - 1u; i > static_cast<TSize>(0u); --i)
126+
{
127+
pitchBytes[i-1] = extent[i-1] * pitchBytes[i];
128+
}
129+
return pitchBytes;
130+
}
131+
119132
public:
120-
TElem * m_pMem;
121-
TDev m_dev;
122-
Vec<TDim, TSize> m_extentElements;
123-
Vec<TDim, TSize> m_pitchBytes;
133+
TElem * const m_pMem;
134+
TDev const m_dev;
135+
Vec<TDim, TSize> const m_extentElements;
136+
Vec<TDim, TSize> const m_pitchBytes;
124137
};
125138
}
126139
}

0 commit comments

Comments
 (0)