Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 4c5370be authored by Sadr Mohsen's avatar Sadr Mohsen
Browse files

add KOKKOS_INLINE_FUNCTION, to resolve kick and dot

parent 7424ee24
No related branches found
No related tags found
2 merge requests!7GPU compilable,!6GPU compilable version of OPAL-X
......@@ -32,6 +32,8 @@
// by the compiler perform the correct operation. For speed reasons
// they are not implemented.
#include <Kokkos_Core.hpp>
class PartData {
public:
......@@ -48,10 +50,10 @@ public:
PartData();
/// The constant charge per particle.
double getQ() const;
KOKKOS_INLINE_FUNCTION double getQ() const;
/// The constant mass per particle.
double getM() const;
KOKKOS_INLINE_FUNCTION double getM() const;
/// The constant reference momentum per particle.
double getP() const;
......@@ -101,12 +103,12 @@ protected:
// Inline functions.
// ------------------------------------------------------------------------
inline double PartData::getQ() const {
KOKKOS_INLINE_FUNCTION double PartData::getQ() const {
return charge;
}
inline double PartData::getM() const {
KOKKOS_INLINE_FUNCTION double PartData::getM() const {
return mass;
}
......
......@@ -81,13 +81,13 @@ enum UnitState_t { units = 0, unitless = 1 };
// euclidean norm
template <class T, unsigned D>
inline double euclidean_norm(const Vector_t<T, D>& v) {
return std::sqrt(dot(v, v).apply());
KOKKOS_INLINE_FUNCTION double euclidean_norm(const Vector_t<T, D>& v) {
return Kokkos::sqrt(dot(v, v).apply());
}
// dot products
template <class T, unsigned D>
inline double dot(const Vector_t<T, D>& v, const Vector_t<T, D>& w) {
KOKKOS_INLINE_FUNCTION double dot(const Vector_t<T, D>& v, const Vector_t<T, D>& w) {
double res = 0.0;
for (unsigned i = 0; i < D; i++)
res += v(i) * w(i);
......@@ -95,7 +95,7 @@ inline double dot(const Vector_t<T, D>& v, const Vector_t<T, D>& w) {
}
template <class T, unsigned D>
inline double dot(const Vector_t<T, D>& v) {
KOKKOS_INLINE_FUNCTION double dot(const Vector_t<T, D>& v) {
double res = 0.0;
for (unsigned i = 0; i < D; i++)
res += v(i) * v(i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment