forked from lijiext/lammps
Merge pull request #2765 from masterleinad/fix_snap_kokkos_sycl
Fix compiling the SNAP module with Kokkos and SYCL
This commit is contained in:
commit
b23556e1a8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue