aboutsummaryrefslogtreecommitdiff
path: root/src/local_reductions.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/local_reductions.h')
-rw-r--r--src/local_reductions.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/local_reductions.h b/src/local_reductions.h
index 6f073b2..3e3eba8 100644
--- a/src/local_reductions.h
+++ b/src/local_reductions.h
@@ -48,7 +48,7 @@ extern "C" {
} \
sum_indices += actual_indices[k]*product; \
} \
- inval = (out_type) typed_vdata[sum_indices]; \
+ REDUCTION_PREOP_CAST(inval, typed_vdata,sum_indices, out_type); \
REDUCTION_OPERATION(*outval,inval); \
num_points++; \
iter++; \
@@ -103,7 +103,7 @@ extern "C" {
CCTK_WARN(1,"offsets and strides access unallocated memory"); \
return -1; \
} \
- inval = (out_type) typed_vdata[sum_indices]; \
+ REDUCTION_PREOP_CAST(inval, typed_vdata,sum_indices, out_type); \
REDUCTION_OPERATION(*outval,inval); \
num_points++; \
iter++; \
@@ -145,18 +145,20 @@ extern "C" {
} \
EXTRA_STEP(*outval, (out_type)num_points) \
}
-
+
int LocalReduce_Mean (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
-int LocalReduce_Count (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
int LocalReduce_Max (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
int LocalReduce_Min (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
+int LocalReduce_Count (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
+int LocalReduce_Sum (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
+
int LocalReduce_L1 (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
int LocalReduce_L2 (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
int LocalReduce_L3 (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
int LocalReduce_L4 (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
int LocalReduce_LInf (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
-int LocalReduce_Sum (REDUCTION_LOCAL_ARRAY_OPERATOR_REGISTER_ARGLIST);
+
typedef int (*reduction_fn_t) (int N_dims, int operator_handle,
int param_table_handle, int N_input_arrays,
@@ -176,9 +178,13 @@ int LocalReduce_Reduce (int N_dims, int operator_handle,
const CCTK_INT output_number_type_codes[],
void * const output_numbers[],reduction_fn_t reduction_fn);
+
+
#ifdef __cplusplus
}
#endif
+
+
#endif