Skip to content

Commit 1a7c4ca

Browse files
committed
add kernel compatibility sqrt
1 parent 7955f80 commit 1a7c4ca

File tree

1 file changed

+5
-6
lines changed
  • src/libPMacc/include/math/vector/math_functor

1 file changed

+5
-6
lines changed

src/libPMacc/include/math/vector/math_functor/sqrtf.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2013 Heiko Burau, Rene Widera
2+
* Copyright 2013, 2015 Heiko Burau, Rene Widera, Richard Pausch
33
*
44
* This file is part of libPMacc.
55
*
@@ -20,11 +20,11 @@
2020
* If not, see <http://www.gnu.org/licenses/>.
2121
*/
2222

23-
#ifndef MATH_FUNCTOR_SQRTF_HPP
24-
#define MATH_FUNCTOR_SQRTF_HPP
23+
#pragma once
2524

2625
#include "types.h"
2726
#include "lambda/Expression.hpp"
27+
#include "algorithms/math/defines/sqrt.hpp"
2828

2929
namespace PMacc
3030
{
@@ -37,9 +37,9 @@ struct Sqrtf
3737
{
3838
typedef float result_type;
3939

40-
HDINLINE float operator()(const float& value) const
40+
HDINLINE result_type operator()(const result_type& value) const
4141
{
42-
return __sqrtf(value);
42+
return algorithms::math::sqrt(value);
4343
}
4444
};
4545

@@ -49,4 +49,3 @@ lambda::Expression<lambda::exprTypes::terminal, mpl::vector<Sqrtf> > _sqrtf;
4949
} // math
5050
} // PMacc
5151

52-
#endif // MATH_FUNCTOR_SQRTF_HPP

0 commit comments

Comments
 (0)