QMCPACK
OMPTargetMath.hpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 /**@file OMPTargetMath.hpp
14  *@brief handle math function mapping inside OpenMP offload regions.
15  */
16 
17 #ifndef OMPTARGET_MATH_H
18 #define OMPTARGET_MATH_H
19 
20 #include <cmath>
21 #if !defined(ENABLE_OFFLOAD)
22 #include "CPU/math.hpp"
23 #endif
24 
25 namespace omptarget
26 {
27 #if defined(ENABLE_OFFLOAD)
28 inline void sincos(double a, double* restrict s, double* restrict c) { ::sincos(a, s, c); }
29 
30 inline void sincos(float a, float* restrict s, float* restrict c) { ::sincosf(a, s, c); }
31 #else
32 using namespace qmcplusplus;
33 #endif
34 
35 template<typename T>
36 T min(T a, T b)
37 {
38  return a < b ? a : b;
39 }
40 } // namespace omptarget
41 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
T min(T a, T b)
void sincos(T a, T *restrict s, T *restrict c)
sincos function wrapper
Definition: math.hpp:62