Merge pull request #2765 from masterleinad/fix_snap_kokkos_sycl

Fix compiling the SNAP module with Kokkos and SYCL
This commit is contained in:
Axel Kohlmeyer 2021-05-14 20:31:53 -04:00 committed by GitHub
commit b23556e1a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 2 deletions

View File

@ -23,6 +23,10 @@
#include <Kokkos_Core.hpp>
#include "kokkos_type.h"
#ifdef __SYCL_DEVICE_ONLY__
#include <CL/sycl.hpp>
#endif
namespace LAMMPS_NS {
template<typename real_type_, int vector_length_>
@ -164,9 +168,21 @@ inline
void compute_s_dsfac(const real_type, const real_type, real_type&, real_type&); // compute_cayley_klein
static KOKKOS_FORCEINLINE_FUNCTION
void sincos_wrapper(double x, double* sin_, double *cos_) { sincos(x, sin_, cos_); }
void sincos_wrapper(double x, double* sin_, double *cos_) {
#ifdef __SYCL_DEVICE_ONLY__
*sin_ = sycl::sincos(x, cos_);
#else
sincos(x, sin_, cos_);
#endif
}
static KOKKOS_FORCEINLINE_FUNCTION
void sincos_wrapper(float x, float* sin_, float *cos_) { sincosf(x, sin_, cos_); }
void sincos_wrapper(float x, float* sin_, float *cos_) {
#ifdef __SYCL_DEVICE_ONLY__
*sin_ = sycl::sincos(x, cos_);
#else
sincosf(x, sin_, cos_);
#endif
}
#ifdef TIMING_INFO
double* timers;