Skip to content

Commit

Permalink
Merge pull request #4337 from psychocoderHPC/fix-returnLocalAddress
Browse files Browse the repository at this point in the history
fix precision cast is returning a reference
  • Loading branch information
jkelling authored Nov 8, 2022
2 parents 6265559 + ce64b60 commit 373bc27
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/picongpu/plugins/radiation/amplitude.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ namespace pmacc
template<typename CastToType>
struct TypeCast<CastToType, picongpu::plugins::radiation::Amplitude<CastToType>>
{
using result = const picongpu::plugins::radiation::Amplitude<CastToType>&;
using result = const picongpu::plugins::radiation::Amplitude<CastToType>;

HDINLINE result operator()(result amplitude) const
HDINLINE result operator()(result const& amplitude) const
{
return amplitude;
}
Expand Down
2 changes: 1 addition & 1 deletion include/pmacc/dimensions/DataSpace.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace pmacc
template<unsigned T_Dim>
struct TypeCast<int, pmacc::DataSpace<T_Dim>>
{
using result = const pmacc::DataSpace<T_Dim>&;
using result = const pmacc::DataSpace<T_Dim>;

HDINLINE result operator()(const pmacc::DataSpace<T_Dim>& vector) const
{
Expand Down
2 changes: 1 addition & 1 deletion include/pmacc/math/complex/Complex.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace pmacc
template<typename T_CastToType>
struct TypeCast<T_CastToType, alpaka::Complex<T_CastToType>>
{
using result = const alpaka::Complex<T_CastToType>&;
using result = const alpaka::Complex<T_CastToType>;

HDINLINE result operator()(const alpaka::Complex<T_CastToType>& complexNumber) const
{
Expand Down
5 changes: 3 additions & 2 deletions include/pmacc/math/vector/Vector.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,10 @@ namespace pmacc
template<typename CastToType, int dim, typename T_Accessor, typename T_Navigator, typename T_Storage>
struct TypeCast<CastToType, ::pmacc::math::Vector<CastToType, dim, T_Accessor, T_Navigator, T_Storage>>
{
using result = const ::pmacc::math::Vector<CastToType, dim, T_Accessor, T_Navigator, T_Storage>&;
using result = ::pmacc::math::Vector<CastToType, dim>;
using ParamType = ::pmacc::math::Vector<CastToType, dim, T_Accessor, T_Navigator, T_Storage>;

HDINLINE result operator()(result vector) const
HDINLINE result operator()(ParamType const& vector) const
{
return vector;
}
Expand Down

0 comments on commit 373bc27

Please sign in to comment.