Astaroth  3.1
Scalable Multi-GPU Stencil Computations
Loading...
Searching...
No Matches
ac_helpers.h
Go to the documentation of this file.
1#pragma once
2
3#include "acc_runtime.h"
4#include "acreal.h"
6#include "astaroth_helpers.h"
7#include "func_define.h"
8#include "host_datatypes.h"
9#include "ac_reduce_helpers.h"
10
12
13void
15
16void
18
19int
21
22bool
24
25void
27
28void
29ac_mpi_bcast(int* res, const AcMeshInfo info);
30
31size_t
32acShapeCount(const AcShape shape);
33
34int
35acGetNumOfWarps(const dim3 bpg, const dim3 tpb);
36
37int
39
40bool
42
43size_t acGetSizeFromDim(const int dim, const Volume dims);
44
45Volume acGetVolumeFromShape(const AcShape shape);
46
47size_t
49
50size_t
51acDeviceResize(void** dst,const size_t old_bytes,const size_t new_bytes);
52
53Volume
54get_bpg(Volume dims, const Volume tpb);
55
59
60// Returns the number of elements contained within shape
61size_t acShapeSize(const AcShape shape);
62
64
65#ifdef __cplusplus
66
67cudaDeviceProp get_device_prop();
68
69int3
70ceil(AcReal3 a);
71
73ceil_div(const size3_t& a, const int3& b);
74
76ceil_div(const size3_t& a, const size3_t& b);
77
78int3
79ceil_div(const int3& a, const int3& b);
80
81size_t
82ceil_div(const size_t& a, const size_t& b);
83
85ceil_div(const size3_t& a, const int& b);
86
87void
88acDeviceMalloc(void** dst, const size_t bytes);
89void
90acDeviceMalloc(AcReal** dst, const size_t bytes);
91
92void
93acDeviceFree(void** dst, const int bytes);
94void
95acDeviceFree(AcReal** dst, const int bytes);
96void
97acDeviceFree(AcComplex** dst, const int bytes);
98
99#endif
void ac_restore_floating_point_exceptions()
AcShape acGetTransposeBufferShape(const AcMeshOrder order, const Volume dims)
int acGetCurrentDevice()
int ac_mpi_rank(const AcMeshInfo info)
AcShape acGetReductionShape(const AcProfileType type, const AcMeshDims dims)
size_t acShapeSize(const AcShape shape)
size_t acGetSizeFromDim(const int dim, const Volume dims)
size_t acGetAmountOfDeviceMemoryFree()
Volume acGetVolumeFromShape(const AcShape shape)
size_t acShapeCount(const AcShape shape)
void ac_unset_floating_point_exceptions()
bool ac_mpi_root(const AcMeshInfo info)
size_t acDeviceResize(void **dst, const size_t old_bytes, const size_t new_bytes)
int acGetNumOfWarps(const dim3 bpg, const dim3 tpb)
void ac_mpi_bcast(int *res, const AcMeshInfo info)
void ac_mpi_barrier(const AcMeshInfo info)
bool acSupportsCooperativeLaunches()
AcMeshOrder acGetMeshOrderForProfile(const AcProfileType type)
Volume get_bpg(Volume dims, const Volume tpb)
float AcReal
Definition acreal.h:11
static const Stream const AcMeshOrder order
Definition astaroth_device.h:187
#define AC_BEGIN_C_DECLARATIONS
Definition func_define.h:14
#define AC_END_C_DECLARATIONS
Definition func_define.h:15
#define cudaDeviceProp
Definition hip.h:71
Volume size3_t
Definition host_datatypes.h:76
AcProfileType
Definition host_datatypes.h:35
AcMeshOrder
Definition host_datatypes.h:17
Definition host_datatypes.h:84
Definition acc_runtime.h:156
Definition host_datatypes.h:48
static __device__ const int dims
Definition user_kernel.h:128