diff --git a/src/libPMacc/include/memory/boxes/CachedBox.hpp b/src/libPMacc/include/memory/boxes/CachedBox.hpp index 0fc6ecc6f2..0e4aea0dca 100644 --- a/src/libPMacc/include/memory/boxes/CachedBox.hpp +++ b/src/libPMacc/include/memory/boxes/CachedBox.hpp @@ -33,19 +33,19 @@ namespace PMacc namespace intern { - template< typename ValueType_, class BlockDescription_, uint32_t Id_> + template< typename T_ValueType, class T_BlockDescription, uint32_t T_Id> class CachedBox { public: - typedef BlockDescription_ BlockDescription; - typedef ValueType_ ValueType; + typedef T_BlockDescription BlockDescription; + typedef T_ValueType ValueType; private: typedef typename BlockDescription::SuperCellSize SuperCellSize; typedef typename BlockDescription::FullSuperCellSize FullSuperCellSize; typedef typename BlockDescription::OffsetOrigin OffsetOrigin; public: - typedef DataBox > Type; + typedef DataBox > Type; HDINLINE static Type create() { diff --git a/src/libPMacc/include/memory/boxes/SharedBox.hpp b/src/libPMacc/include/memory/boxes/SharedBox.hpp index ef4f58a775..d7be58e4a6 100644 --- a/src/libPMacc/include/memory/boxes/SharedBox.hpp +++ b/src/libPMacc/include/memory/boxes/SharedBox.hpp @@ -32,11 +32,19 @@ namespace PMacc { -template +/** create shared momory on gpu + * + * @tparam T_TYPE type of memory objects + * @tparam T_Vector CT::Vector with size description (per dimension) + * @tparam T_id unique id for this object + * (is needed if more than one instance of shared memory in one kernel is used) + * @tparam T_dim dimension of the momory (supports DIM1,DIM2 and DIM3) + */ +template class SharedBox; -template -class SharedBox +template +class SharedBox { public: @@ -47,8 +55,8 @@ class SharedBox typedef T_TYPE ValueType; typedef ValueType& RefValueType; typedef T_Vector Size; - typedef SharedBox > ReducedType; - typedef SharedBox This; + typedef SharedBox, T_id > ReducedType; + typedef SharedBox This; HDINLINE RefValueType operator[](const int idx) { @@ -88,7 +96,7 @@ class SharedBox { __shared__ ValueType mem_sh[Size::x::value]; __syncthreads(); /*wait that all shared memory is initialised*/ - return SharedBox >((ValueType*) mem_sh); + return This((ValueType*) mem_sh); } protected: @@ -96,8 +104,8 @@ class SharedBox PMACC_ALIGN(fixedPointer, ValueType*); }; -template -class SharedBox +template +class SharedBox { public: @@ -108,8 +116,8 @@ class SharedBox typedef T_TYPE ValueType; typedef ValueType& RefValueType; typedef T_Vector Size; - typedef SharedBox > ReducedType; - typedef SharedBox This; + typedef SharedBox, T_id > ReducedType; + typedef SharedBox This; HDINLINE SharedBox(ValueType* pointer = NULL) : fixedPointer(pointer) @@ -159,8 +167,8 @@ class SharedBox PMACC_ALIGN(fixedPointer, ValueType*); }; -template -class SharedBox +template +class SharedBox { public: @@ -171,8 +179,8 @@ class SharedBox typedef T_TYPE ValueType; typedef ValueType& RefValueType; typedef T_Vector Size; - typedef SharedBox > ReducedType; - typedef SharedBox This; + typedef SharedBox, T_id > ReducedType; + typedef SharedBox This; HDINLINE ReducedType operator[](const int idx) {