25#ifndef AC_RUNTIME_SOURCE
29#include "user_defines.h"
44extern __device__
AcReal stencils[NUM_STENCILS][STENCIL_DEPTH][STENCIL_HEIGHT][STENCIL_WIDTH];
46#define d_multigpu_offset (d_mesh_info.int3_params[AC_multigpu_offset])
48#include "dconst_decl.h"
49#include "get_address.h"
50#include "reduce_helpers_decls.h"
51#include "output_value_decl.h"
52#include "user_defines_runtime_lib.h"
56#define PROFILE_X_Y_OR_Z_INDEX(i, j) ((i) + (j) * VAL(AC_mlocal).x)
57#define PROFILE_Y_X_OR_Z_INDEX(i, j) ((i) + (j) * VAL(AC_mlocal).y)
58#define PROFILE_Z_X_OR_Y_INDEX(i, j) ((i) + (j) * VAL(AC_mlocal).z)
59#define DEVICE_VTXBUF_IDX(i, j, k) \
60 ((i) + (j) * VAL(AC_mlocal).x + (k) * VAL(AC_mlocal_products).xy)
61#define DEVICE_VARIABLE_VTXBUF_IDX(i, j, k, dims) \
62 ((i) + dims.x * ((j) + (k) * dims.y))
63#define LOCAL_COMPDOMAIN_IDX(coord) \
64 ((coord.x) + (coord.y) * VAL(AC_nlocal).x + \
65 (coord.z) * VAL(AC_nlocal_products).xy)
68 if (!DCONST(AC_autotuning_at_work)) \
69 printf(__VA_ARGS__); \
71#define suppress_unused_warning(X) (void)X
72#define longlong long long
74 (int)(sizeof(arr) / sizeof(arr[0]))
75#define error_message(error, message)
76#define fatal_error_message(error, message)
77#define ac_dummy_write(field, x, y, z)
79#define ac_dynamic_stencils_begin()
80#define ac_dynamic_stencils_end()
81#define postprocess_reduce_result(DST,OP)
83#include "device_fields_info.h"
84#include "device_output_info.h"
86static __device__
UNUSED int3
87ac_get_field_halos(
const Field& field)
89 if (vtxbuf_compile_time_device_halos[field] != (int3){-1, -1, -1}) {
90 return vtxbuf_compile_time_device_halos[field];
92 return VAL(vtxbuf_run_time_device_halos[field]);
95static __device__
UNUSED bool
96ac_field_has_default_dims(
const Field& field)
98 return vtxbuf_device_dims[field] == AC_mlocal;
101static __device__
UNUSED bool
102ac_is_global(
const AcRealOutputParam&
param)
104 return real_output_is_global_device[
param];
108safe_access(
const AcReal* arr,
const int dims,
const int index,
const char* name)
112 printf(
"Trying to access %s which is NULL!\n",name);
119 printf(
"Trying to access %s out of bounds!: %d\n",name,
index);
130 return safe_access(arr,
dims,
index,real_array_names__device__[
param]);
float AcReal
Definition acreal.h:11
#define UNUSED
Definition func_attributes.h:4
Definition acc_runtime.h:151
Definition acc_runtime.h:185
__device__ __constant__ AcMeshInfoScalars d_mesh_info
__device__ AcReal stencils[NUM_STENCILS][STENCIL_DEPTH][STENCIL_HEIGHT][STENCIL_WIDTH]
static __device__ const int dims
Definition user_kernel.h:128
void(* Kernel)(const int3, const int3, DeviceVertexBufferArray vba)
Definition user_kernel.h:42
static __device__ const int const int index
Definition user_kernel.h:128
static __device__ const int const int const AcRealArrayParam param
Definition user_kernel.h:129