aboutsummaryrefslogtreecommitdiff
path: root/Source/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Parser')
-rw-r--r--Source/Parser/GpuParser.H8
-rw-r--r--Source/Parser/WarpXParser.H26
-rw-r--r--Source/Parser/WarpXParser.cpp4
-rw-r--r--Source/Parser/wp_parser.tab.c2
-rw-r--r--Source/Parser/wp_parser.tab.h2
-rw-r--r--Source/Parser/wp_parser.y2
-rw-r--r--Source/Parser/wp_parser_c.h9
-rw-r--r--Source/Parser/wp_parser_y.c82
-rw-r--r--Source/Parser/wp_parser_y.h21
9 files changed, 79 insertions, 77 deletions
diff --git a/Source/Parser/GpuParser.H b/Source/Parser/GpuParser.H
index e49671e06..c158ee314 100644
--- a/Source/Parser/GpuParser.H
+++ b/Source/Parser/GpuParser.H
@@ -16,16 +16,16 @@ public:
void clear ();
AMREX_GPU_HOST_DEVICE
- double
- operator() (double x, double y, double z) const noexcept
+ amrex::Real
+ operator() (amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
{
#ifdef AMREX_USE_GPU
#ifdef AMREX_DEVICE_COMPILE
// WarpX compiled for GPU, function compiled for __device__
// the 3D position of each particle is stored in shared memory.
- amrex::Gpu::SharedMemory<double> gsm;
- double* p = gsm.dataPtr();
+ amrex::Gpu::SharedMemory<amrex::Real> gsm;
+ amrex::Real* p = gsm.dataPtr();
int tid = threadIdx.x + threadIdx.y*blockDim.x + threadIdx.z*(blockDim.x*blockDim.y);
p[tid*3] = x;
p[tid*3+1] = y;
diff --git a/Source/Parser/WarpXParser.H b/Source/Parser/WarpXParser.H
index ffa61e457..8c1d854d8 100644
--- a/Source/Parser/WarpXParser.H
+++ b/Source/Parser/WarpXParser.H
@@ -6,6 +6,8 @@
#include <string>
#include <set>
+#include <AMReX_REAL.H>
+
#include "wp_parser_c.h"
#include "wp_parser_y.h"
@@ -23,15 +25,15 @@ public:
~WarpXParser ();
void define (std::string const& func_body);
- void setConstant (std::string const& name, double c);
+ void setConstant (std::string const& name, amrex::Real c);
//
// Option 1: Register every variable to an address provided.
// Assign values to external variables.
// Call eval().
- void registerVariable (std::string const& name, double& var);
+ void registerVariable (std::string const& name, amrex::Real& var);
//
- inline double eval () const noexcept;
+ inline amrex::Real eval () const noexcept;
//
// Option 2: Register all variables at once. Parser will create
@@ -40,7 +42,7 @@ public:
void registerVariables (std::vector<std::string> const& names);
//
template <typename T, typename... Ts> inline
- double eval (T x, Ts... yz) const noexcept;
+ amrex::Real eval (T x, Ts... yz) const noexcept;
void print () const;
@@ -54,23 +56,23 @@ private:
void clear ();
template <typename T> inline
- void unpack (double* p, T x) const noexcept;
+ void unpack (amrex::Real* p, T x) const noexcept;
template <typename T, typename... Ts> inline
- void unpack (double* p, T x, Ts... yz) const noexcept;
+ void unpack (amrex::Real* p, T x, Ts... yz) const noexcept;
std::string m_expression;
#ifdef _OPENMP
std::vector<struct wp_parser*> m_parser;
- mutable std::vector<std::array<double,16> > m_variables;
+ mutable std::vector<std::array<amrex::Real,16> > m_variables;
#else
struct wp_parser* m_parser = nullptr;
- mutable std::array<double,16> m_variables;
+ mutable std::array<amrex::Real,16> m_variables;
#endif
};
inline
-double
+amrex::Real
WarpXParser::eval () const noexcept
{
#ifdef _OPENMP
@@ -82,7 +84,7 @@ WarpXParser::eval () const noexcept
template <typename T, typename... Ts>
inline
-double
+amrex::Real
WarpXParser::eval (T x, Ts... yz) const noexcept
{
#ifdef _OPENMP
@@ -96,7 +98,7 @@ WarpXParser::eval (T x, Ts... yz) const noexcept
template <typename T>
inline
void
-WarpXParser::unpack (double* p, T x) const noexcept
+WarpXParser::unpack (amrex::Real* p, T x) const noexcept
{
*p = x;
}
@@ -104,7 +106,7 @@ WarpXParser::unpack (double* p, T x) const noexcept
template <typename T, typename... Ts>
inline
void
-WarpXParser::unpack (double* p, T x, Ts... yz) const noexcept
+WarpXParser::unpack (amrex::Real* p, T x, Ts... yz) const noexcept
{
*p++ = x;
unpack(p, yz...);
diff --git a/Source/Parser/WarpXParser.cpp b/Source/Parser/WarpXParser.cpp
index 3237086f2..ced536327 100644
--- a/Source/Parser/WarpXParser.cpp
+++ b/Source/Parser/WarpXParser.cpp
@@ -69,7 +69,7 @@ WarpXParser::clear ()
}
void
-WarpXParser::registerVariable (std::string const& name, double& var)
+WarpXParser::registerVariable (std::string const& name, amrex::Real& var)
{
// We assume this is called inside OMP parallel region
#ifdef _OPENMP
@@ -105,7 +105,7 @@ WarpXParser::registerVariables (std::vector<std::string> const& names)
}
void
-WarpXParser::setConstant (std::string const& name, double c)
+WarpXParser::setConstant (std::string const& name, amrex::Real c)
{
#ifdef _OPENMP
diff --git a/Source/Parser/wp_parser.tab.c b/Source/Parser/wp_parser.tab.c
index 3981894a5..0f7c2403d 100644
--- a/Source/Parser/wp_parser.tab.c
+++ b/Source/Parser/wp_parser.tab.c
@@ -138,7 +138,7 @@ union YYSTYPE
#line 19 "wp_parser.y" /* yacc.c:352 */
struct wp_node* n;
- double d;
+ amrex_real d;
struct wp_symbol* s;
enum wp_f1_t f1;
enum wp_f2_t f2;
diff --git a/Source/Parser/wp_parser.tab.h b/Source/Parser/wp_parser.tab.h
index b50516808..0c859fc03 100644
--- a/Source/Parser/wp_parser.tab.h
+++ b/Source/Parser/wp_parser.tab.h
@@ -75,7 +75,7 @@ union YYSTYPE
#line 19 "wp_parser.y" /* yacc.c:1921 */
struct wp_node* n;
- double d;
+ amrex_real d;
struct wp_symbol* s;
enum wp_f1_t f1;
enum wp_f2_t f2;
diff --git a/Source/Parser/wp_parser.y b/Source/Parser/wp_parser.y
index 453eda1cd..809dbfa5e 100644
--- a/Source/Parser/wp_parser.y
+++ b/Source/Parser/wp_parser.y
@@ -18,7 +18,7 @@
*/
%union {
struct wp_node* n;
- double d;
+ amrex_real d;
struct wp_symbol* s;
enum wp_f1_t f1;
enum wp_f2_t f2;
diff --git a/Source/Parser/wp_parser_c.h b/Source/Parser/wp_parser_c.h
index 3aafdec65..970d6b355 100644
--- a/Source/Parser/wp_parser_c.h
+++ b/Source/Parser/wp_parser_c.h
@@ -4,6 +4,7 @@
#include "wp_parser_y.h"
#include <AMReX_GpuQualifiers.H>
#include <AMReX_Extension.H>
+#include <AMReX_REAL.H>
#ifdef __cplusplus
extern "C" {
@@ -21,15 +22,15 @@ extern "C" {
#include <string>
AMREX_GPU_HOST_DEVICE
-inline double
+inline amrex_real
wp_ast_eval (struct wp_node* node)
{
- double result;
+ amrex_real result;
#ifdef AMREX_DEVICE_COMPILE
- extern __shared__ double extern_xyz[];
+ extern __shared__ amrex_real extern_xyz[];
int tid = threadIdx.x + threadIdx.y*blockDim.x + threadIdx.z*(blockDim.x*blockDim.y);
- double* x = extern_xyz + tid*3;
+ amrex_real* x = extern_xyz + tid*3;
#endif
switch (node->type)
diff --git a/Source/Parser/wp_parser_y.c b/Source/Parser/wp_parser_y.c
index 259f9368b..b71b42638 100644
--- a/Source/Parser/wp_parser_y.c
+++ b/Source/Parser/wp_parser_y.c
@@ -6,8 +6,6 @@
#include "wp_parser_y.h"
#include "wp_parser.tab.h"
-#include <AMReX_GpuQualifiers.H>
-
static struct wp_node* wp_root = NULL;
/* This is called by a bison rule to store the original AST in a
@@ -21,7 +19,7 @@ wp_defexpr (struct wp_node* body)
}
struct wp_node*
-wp_newnumber (double d)
+wp_newnumber (amrex_real d)
{
struct wp_number* r = (struct wp_number*) malloc(sizeof(struct wp_number));
r->type = WP_NUMBER;
@@ -154,8 +152,8 @@ wp_parser_dup (struct wp_parser* source)
}
AMREX_GPU_HOST_DEVICE
-double
-wp_call_f1 (enum wp_f1_t type, double a)
+amrex_real
+wp_call_f1 (enum wp_f1_t type, amrex_real a)
{
switch (type) {
case WP_SQRT: return sqrt(a);
@@ -185,8 +183,8 @@ wp_call_f1 (enum wp_f1_t type, double a)
}
AMREX_GPU_HOST_DEVICE
-double
-wp_call_f2 (enum wp_f2_t type, double a, double b)
+amrex_real
+wp_call_f2 (enum wp_f2_t type, amrex_real a, amrex_real b)
{
switch (type) {
case WP_POW:
@@ -356,13 +354,13 @@ wp_parser_ast_dup (struct wp_parser* my_parser, struct wp_node* node, int move)
#define WP_MOVEUP_R(node, v) \
struct wp_node* n = node->r->r; \
- double* p = node->r->rip.p; \
+ amrex_real* p = node->r->rip.p; \
node->r = n; \
node->lvp.v = v; \
node->rip.p = p;
#define WP_MOVEUP_L(node, v) \
struct wp_node* n = node->l->r; \
- double* p = node->l->rip.p; \
+ amrex_real* p = node->l->rip.p; \
node->r = n; \
node->lvp.v = v; \
node->rip.p = p;
@@ -392,7 +390,7 @@ wp_ast_optimize (struct wp_node* node)
if (node->l->type == WP_NUMBER &&
node->r->type == WP_NUMBER)
{
- double v = ((struct wp_number*)(node->l))->value
+ amrex_real v = ((struct wp_number*)(node->l))->value
+ ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
@@ -422,28 +420,28 @@ wp_ast_optimize (struct wp_node* node)
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_ADD_VP)
{
- double v = ((struct wp_number*)(node->l))->value + WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value + WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_ADD_VP;
}
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_SUB_VP)
{
- double v = ((struct wp_number*)(node->l))->value + WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value + WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_SUB_VP;
}
else if (node->l->type == WP_ADD_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) + ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) + ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_ADD_VP;
}
else if (node->l->type == WP_SUB_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) + ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) + ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_SUB_VP;
}
@@ -455,7 +453,7 @@ wp_ast_optimize (struct wp_node* node)
if (node->l->type == WP_NUMBER &&
node->r->type == WP_NUMBER)
{
- double v = ((struct wp_number*)(node->l))->value
+ amrex_real v = ((struct wp_number*)(node->l))->value
- ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
@@ -485,28 +483,28 @@ wp_ast_optimize (struct wp_node* node)
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_ADD_VP)
{
- double v = ((struct wp_number*)(node->l))->value - WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value - WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_SUB_VP;
}
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_SUB_VP)
{
- double v = ((struct wp_number*)(node->l))->value - WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value - WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_ADD_VP;
}
else if (node->l->type == WP_ADD_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) - ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) - ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_ADD_VP;
}
else if (node->l->type == WP_SUB_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) - ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) - ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_SUB_VP;
}
@@ -518,7 +516,7 @@ wp_ast_optimize (struct wp_node* node)
if (node->l->type == WP_NUMBER &&
node->r->type == WP_NUMBER)
{
- double v = ((struct wp_number*)(node->l))->value
+ amrex_real v = ((struct wp_number*)(node->l))->value
* ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
@@ -548,28 +546,28 @@ wp_ast_optimize (struct wp_node* node)
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_MUL_VP)
{
- double v = ((struct wp_number*)(node->l))->value * WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value * WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_MUL_VP;
}
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_DIV_VP)
{
- double v = ((struct wp_number*)(node->l))->value * WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value * WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_DIV_VP;
}
else if (node->l->type == WP_MUL_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) * ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) * ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_MUL_VP;
}
else if (node->l->type == WP_DIV_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) * ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) * ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_DIV_VP;
}
@@ -581,7 +579,7 @@ wp_ast_optimize (struct wp_node* node)
if (node->l->type == WP_NUMBER &&
node->r->type == WP_NUMBER)
{
- double v = ((struct wp_number*)(node->l))->value
+ amrex_real v = ((struct wp_number*)(node->l))->value
/ ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
@@ -611,28 +609,28 @@ wp_ast_optimize (struct wp_node* node)
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_MUL_VP)
{
- double v = ((struct wp_number*)(node->l))->value / WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value / WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_DIV_VP;
}
else if (node->l->type == WP_NUMBER &&
node->r->type == WP_DIV_VP)
{
- double v = ((struct wp_number*)(node->l))->value / WP_EVAL_R(node);
+ amrex_real v = ((struct wp_number*)(node->l))->value / WP_EVAL_R(node);
WP_MOVEUP_R(node, v);
node->type = WP_MUL_VP;
}
else if (node->l->type == WP_MUL_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) / ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) / ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_MUL_VP;
}
else if (node->l->type == WP_DIV_VP &&
node->r->type == WP_NUMBER)
{
- double v = WP_EVAL_L(node) / ((struct wp_number*)(node->r))->value;
+ amrex_real v = WP_EVAL_L(node) / ((struct wp_number*)(node->r))->value;
WP_MOVEUP_L(node, v);
node->type = WP_DIV_VP;
}
@@ -641,7 +639,7 @@ wp_ast_optimize (struct wp_node* node)
wp_ast_optimize(node->l);
if (node->l->type == WP_NUMBER)
{
- double v = -((struct wp_number*)(node->l))->value;
+ amrex_real v = -((struct wp_number*)(node->l))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
}
@@ -675,7 +673,7 @@ wp_ast_optimize (struct wp_node* node)
wp_ast_optimize(node->l);
if (node->l->type == WP_NUMBER)
{
- double v = wp_call_f1
+ amrex_real v = wp_call_f1
(((struct wp_f1*)node)->ftype,
((struct wp_number*)(((struct wp_f1*)node)->l))->value);
((struct wp_number*)node)->type = WP_NUMBER;
@@ -688,7 +686,7 @@ wp_ast_optimize (struct wp_node* node)
if (node->l->type == WP_NUMBER &&
node->r->type == WP_NUMBER)
{
- double v = wp_call_f2
+ amrex_real v = wp_call_f2
(((struct wp_f2*)node)->ftype,
((struct wp_number*)(((struct wp_f2*)node)->l))->value,
((struct wp_number*)(((struct wp_f2*)node)->r))->value);
@@ -698,7 +696,7 @@ wp_ast_optimize (struct wp_node* node)
else if (node->r->type == WP_NUMBER && ((struct wp_f2*)node)->ftype == WP_POW)
{
struct wp_node* n = node->l;
- double v = ((struct wp_number*)(node->r))->value;
+ amrex_real v = ((struct wp_number*)(node->r))->value;
if (-3.0 == v) {
((struct wp_f1*)node)->type = WP_F1;
((struct wp_f1*)node)->l = n;
@@ -733,7 +731,7 @@ wp_ast_optimize (struct wp_node* node)
wp_ast_optimize(node->r);
if (node->r->type == WP_NUMBER)
{
- double v = node->lvp.v + ((struct wp_number*)(node->r))->value;
+ amrex_real v = node->lvp.v + ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
}
@@ -742,7 +740,7 @@ wp_ast_optimize (struct wp_node* node)
wp_ast_optimize(node->r);
if (node->r->type == WP_NUMBER)
{
- double v = node->lvp.v - ((struct wp_number*)(node->r))->value;
+ amrex_real v = node->lvp.v - ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
}
@@ -751,7 +749,7 @@ wp_ast_optimize (struct wp_node* node)
wp_ast_optimize(node->r);
if (node->r->type == WP_NUMBER)
{
- double v = node->lvp.v * ((struct wp_number*)(node->r))->value;
+ amrex_real v = node->lvp.v * ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
}
@@ -760,7 +758,7 @@ wp_ast_optimize (struct wp_node* node)
wp_ast_optimize(node->r);
if (node->r->type == WP_NUMBER)
{
- double v = node->lvp.v / ((struct wp_number*)(node->r))->value;
+ amrex_real v = node->lvp.v / ((struct wp_number*)(node->r))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
}
@@ -769,7 +767,7 @@ wp_ast_optimize (struct wp_node* node)
wp_ast_optimize(node->l);
if (node->l->type == WP_NUMBER)
{
- double v = -((struct wp_number*)(node->l))->value;
+ amrex_real v = -((struct wp_number*)(node->l))->value;
((struct wp_number*)node)->type = WP_NUMBER;
((struct wp_number*)node)->value = v;
}
@@ -938,7 +936,7 @@ wp_ast_print (struct wp_node* node)
}
void
-wp_ast_regvar (struct wp_node* node, char const* name, double* p)
+wp_ast_regvar (struct wp_node* node, char const* name, amrex_real* p)
{
switch (node->type)
{
@@ -1047,7 +1045,7 @@ wp_ast_regvar_gpu (struct wp_node* node, char const* name, int i)
}
}
-void wp_ast_setconst (struct wp_node* node, char const* name, double c)
+void wp_ast_setconst (struct wp_node* node, char const* name, amrex_real c)
{
switch (node->type)
{
@@ -1099,7 +1097,7 @@ void wp_ast_setconst (struct wp_node* node, char const* name, double c)
}
void
-wp_parser_regvar (struct wp_parser* parser, char const* name, double* p)
+wp_parser_regvar (struct wp_parser* parser, char const* name, amrex_real* p)
{
wp_ast_regvar(parser->ast, name, p);
}
@@ -1111,7 +1109,7 @@ wp_parser_regvar_gpu (struct wp_parser* parser, char const* name, int i)
}
void
-wp_parser_setconst (struct wp_parser* parser, char const* name, double c)
+wp_parser_setconst (struct wp_parser* parser, char const* name, amrex_real c)
{
wp_ast_setconst(parser->ast, name, c);
wp_ast_optimize(parser->ast);
diff --git a/Source/Parser/wp_parser_y.h b/Source/Parser/wp_parser_y.h
index 8c9f8e4e4..d83815090 100644
--- a/Source/Parser/wp_parser_y.h
+++ b/Source/Parser/wp_parser_y.h
@@ -2,6 +2,7 @@
#define WP_PARSER_Y_H_
#include <AMReX_GpuQualifiers.H>
+#include <AMReX_REAL.H>
#ifdef __cplusplus
#include <cstdlib>
@@ -77,11 +78,11 @@ enum wp_node_t {
union wp_ip {
int i;
- double* p;
+ amrex_real* p;
};
union wp_vp {
- double v;
+ amrex_real v;
union wp_ip ip;
};
@@ -95,7 +96,7 @@ struct wp_node {
struct wp_number {
enum wp_node_t type;
- double value;
+ amrex_real value;
};
struct wp_symbol {
@@ -122,7 +123,7 @@ struct wp_f2 { /* Builtin functions with two arguments */
/* These functions are used in bison rules to generate the original
* AST. */
void wp_defexpr (struct wp_node* body);
-struct wp_node* wp_newnumber (double d);
+struct wp_node* wp_newnumber (amrex_real d);
struct wp_symbol* wp_makesymbol (char* name);
struct wp_node* wp_newsymbol (struct wp_symbol* sym);
struct wp_node* wp_newnode (enum wp_node_t type, struct wp_node* l,
@@ -153,20 +154,20 @@ void wp_parser_delete (struct wp_parser* parser);
struct wp_parser* wp_parser_dup (struct wp_parser* source);
struct wp_node* wp_parser_ast_dup (struct wp_parser* parser, struct wp_node* src, int move);
-void wp_parser_regvar (struct wp_parser* parser, char const* name, double* p);
+void wp_parser_regvar (struct wp_parser* parser, char const* name, amrex_real* p);
void wp_parser_regvar_gpu (struct wp_parser* parser, char const* name, int i);
-void wp_parser_setconst (struct wp_parser* parser, char const* name, double c);
+void wp_parser_setconst (struct wp_parser* parser, char const* name, amrex_real c);
/* We need to walk the tree in these functions */
void wp_ast_optimize (struct wp_node* node);
size_t wp_ast_size (struct wp_node* node);
void wp_ast_print (struct wp_node* node);
-void wp_ast_regvar (struct wp_node* node, char const* name, double* p);
+void wp_ast_regvar (struct wp_node* node, char const* name, amrex_real* p);
void wp_ast_regvar_gpu (struct wp_node* node, char const* name, int i);
-void wp_ast_setconst (struct wp_node* node, char const* name, double c);
+void wp_ast_setconst (struct wp_node* node, char const* name, amrex_real c);
-AMREX_GPU_HOST_DEVICE double wp_call_f1 (enum wp_f1_t type, double a);
-AMREX_GPU_HOST_DEVICE double wp_call_f2 (enum wp_f2_t type, double a, double b);
+AMREX_GPU_HOST_DEVICE amrex_real wp_call_f1 (enum wp_f1_t type, amrex_real a);
+AMREX_GPU_HOST_DEVICE amrex_real wp_call_f2 (enum wp_f2_t type, amrex_real a, amrex_real b);
#ifdef __cplusplus
}