Astaroth  2.2
astaroth.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2020, Johannes Pekkila, Miikka Vaisala.
3 
4  This file is part of Astaroth.
5 
6  Astaroth is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Astaroth is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Astaroth. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #pragma once
20 #include <cuda_runtime_api.h> // Vector types
21 #include <float.h> // FLT_EPSILON, etc
22 #include <stdio.h> // printf
23 #include <stdlib.h> // size_t
24 
25 // Library flags
26 #define STENCIL_ORDER (6)
27 #define NGHOST (STENCIL_ORDER / 2)
28 #define VERBOSE_PRINTING (1)
29 
30 // Built-in types and parameters
31 #if AC_DOUBLE_PRECISION == 1
32 typedef double AcReal;
33 typedef double3 AcReal3;
34 #define AC_REAL_MAX (DBL_MAX)
35 #define AC_REAL_MIN (DBL_MIN)
36 #define AC_REAL_EPSILON (DBL_EPSILON)
37 #else
38 typedef float AcReal;
39 typedef float3 AcReal3;
40 #define AC_REAL_MAX (FLT_MAX)
41 #define AC_REAL_MIN (FLT_MIN)
42 #define AC_REAL_EPSILON (FLT_EPSILON)
43 #endif
44 
45 typedef struct {
46  AcReal3 row[3];
47 } AcMatrix;
48 
49 #include "user_defines.h" // Autogenerated defines from the DSL
50 
51 typedef enum { AC_SUCCESS = 0, AC_FAILURE = 1 } AcResult;
52 
53 typedef enum {
61 
62 typedef enum {
82 } Stream;
83 #define STREAM_ALL (NUM_STREAMS)
84 
85 #define AC_GEN_ID(X) X,
86 typedef enum {
88  NUM_INT_PARAMS
89 } AcIntParam;
90 
91 typedef enum {
93  NUM_INT3_PARAMS
94 } AcInt3Param;
95 
96 typedef enum {
98  NUM_REAL_PARAMS
99 } AcRealParam;
100 
101 typedef enum {
103  NUM_REAL3_PARAMS
104 } AcReal3Param;
105 
106 typedef enum {
108  NUM_SCALARARRAY_HANDLES
110 
111 typedef enum {
113  NUM_VTXBUF_HANDLES
115 #undef AC_GEN_ID
116 
117 #define _UNUSED __attribute__((unused)) // Does not give a warning if unused
118 #define AC_GEN_STR(X) #X,
119 static const char* intparam_names[] _UNUSED = {AC_FOR_USER_INT_PARAM_TYPES(AC_GEN_STR) "-end-"};
120 static const char* int3param_names[] _UNUSED = {AC_FOR_USER_INT3_PARAM_TYPES(AC_GEN_STR) "-end-"};
121 static const char* realparam_names[] _UNUSED = {AC_FOR_USER_REAL_PARAM_TYPES(AC_GEN_STR) "-end-"};
122 static const char* real3param_names[] _UNUSED = {AC_FOR_USER_REAL3_PARAM_TYPES(AC_GEN_STR) "-end-"};
123 static const char* scalararray_names[] _UNUSED = {AC_FOR_SCALARARRAY_HANDLES(AC_GEN_STR) "-end-"};
124 static const char* vtxbuf_names[] _UNUSED = {AC_FOR_VTXBUF_HANDLES(AC_GEN_STR) "-end-"};
125 #undef AC_GEN_STR
126 #undef _UNUSED
127 
128 typedef struct {
129  int int_params[NUM_INT_PARAMS];
130  int3 int3_params[NUM_INT3_PARAMS];
131  AcReal real_params[NUM_REAL_PARAMS];
132  AcReal3 real3_params[NUM_REAL3_PARAMS];
133 } AcMeshInfo;
134 
135 typedef struct {
136  AcReal* vertex_buffer[NUM_VTXBUF_HANDLES];
138 } AcMesh;
139 
140 // Device
141 typedef struct device_s* Device; // Opaque pointer to device_s. Analogous to dispatchable handles
142  // in Vulkan, f.ex. VkDevice
143 
144 // Node
145 typedef struct node_s* Node; // Opaque pointer to node_s.
146 
147 typedef struct {
148  int3 m;
149  int3 n;
150 } Grid; // WARNING: Grid structure may be deprecated in future versions (TODO)
151 
152 typedef struct {
155 
159 
160 #ifdef __cplusplus
161 extern "C" {
162 #endif
163 
164 /*
165  * =============================================================================
166  * Helper functions
167  * =============================================================================
168  */
169 static inline size_t
170 acVertexBufferSize(const AcMeshInfo info)
171 {
172  return info.int_params[AC_mx] * info.int_params[AC_my] * info.int_params[AC_mz];
173 }
174 
175 static inline size_t
176 acVertexBufferSizeBytes(const AcMeshInfo info)
177 {
178  return sizeof(AcReal) * acVertexBufferSize(info);
179 }
180 
181 static inline size_t
182 acVertexBufferCompdomainSize(const AcMeshInfo info)
183 {
184  return info.int_params[AC_nx] * info.int_params[AC_ny] * info.int_params[AC_nz];
185 }
186 
187 static inline size_t
188 acVertexBufferCompdomainSizeBytes(const AcMeshInfo info)
189 {
190  return sizeof(AcReal) * acVertexBufferCompdomainSize(info);
191 }
192 
193 static inline size_t
194 acVertexBufferIdx(const int i, const int j, const int k, const AcMeshInfo info)
195 {
196  return i + //
197  j * info.int_params[AC_mx] + //
198  k * info.int_params[AC_mx] * info.int_params[AC_my];
199 }
200 
202 static inline void
203 acPrintMeshInfo(const AcMeshInfo config)
204 {
205  for (int i = 0; i < NUM_INT_PARAMS; ++i)
206  printf("[%s]: %d\n", intparam_names[i], config.int_params[i]);
207  for (int i = 0; i < NUM_INT3_PARAMS; ++i)
208  printf("[%s]: (%d, %d, %d)\n", int3param_names[i], config.int3_params[i].x,
209  config.int3_params[i].y, config.int3_params[i].z);
210  for (int i = 0; i < NUM_REAL_PARAMS; ++i)
211  printf("[%s]: %g\n", realparam_names[i], (double)(config.real_params[i]));
212  for (int i = 0; i < NUM_REAL3_PARAMS; ++i)
213  printf("[%s]: (%g, %g, %g)\n", real3param_names[i], (double)(config.real3_params[i].x),
214  (double)(config.real3_params[i].y), (double)(config.real3_params[i].z));
215 }
216 
217 /*
218  * =============================================================================
219  * Legacy interface
220  * =============================================================================
221  */
224 AcResult acInit(const AcMeshInfo mesh_info);
225 
228 AcResult acQuit(void);
229 
233 
236 AcResult acSynchronizeStream(const Stream stream);
237 
240 
243 
245 AcResult acLoad(const AcMesh host_mesh);
246 
248 AcResult acStore(AcMesh* host_mesh);
249 
252 AcResult acIntegrate(const AcReal dt);
253 
257 
259 AcReal acReduceScal(const ReductionType rtype, const VertexBufferHandle vtxbuf_handle);
260 
263  const VertexBufferHandle b, const VertexBufferHandle c);
264 
267 AcResult acStoreWithOffset(const int3 dst, const size_t num_vertices, AcMesh* host_mesh);
268 
271 AcResult acIntegrateStep(const int isubstep, const AcReal dt);
272 AcResult acIntegrateStepWithOffset(const int isubstep, const AcReal dt, const int3 start,
273  const int3 end);
274 AcResult acSynchronize(void);
275 AcResult acLoadWithOffset(const AcMesh host_mesh, const int3 src, const int num_vertices);
276 
278 int acGetNumDevicesPerNode(void);
279 
281 Node acGetNode(void);
282 
283 /*
284  * =============================================================================
285  * Node interface
286  * =============================================================================
287  */
307 AcResult acNodeCreate(const int id, const AcMeshInfo node_config, Node* node);
308 
315 
322 AcResult acNodePrintInfo(const Node node);
323 
331 
333 AcResult acNodeAutoOptimize(const Node node);
334 
336 AcResult acNodeSynchronizeStream(const Node node, const Stream stream);
337 
339 AcResult acNodeSynchronizeVertexBuffer(const Node node, const Stream stream,
340  const VertexBufferHandle vtxbuf_handle); // Not in Device
341 
343 AcResult acNodeSynchronizeMesh(const Node node, const Stream stream); // Not in Device
344 
346 AcResult acNodeSwapBuffers(const Node node);
347 
349 AcResult acNodeLoadConstant(const Node node, const Stream stream, const AcRealParam param,
350  const AcReal value);
351 
354 AcResult acNodeLoadVertexBufferWithOffset(const Node node, const Stream stream,
355  const AcMesh host_mesh,
356  const VertexBufferHandle vtxbuf_handle, const int3 src,
357  const int3 dst, const int num_vertices);
358 
360 AcResult acNodeLoadMeshWithOffset(const Node node, const Stream stream, const AcMesh host_mesh,
361  const int3 src, const int3 dst, const int num_vertices);
362 
364 AcResult acNodeLoadVertexBuffer(const Node node, const Stream stream, const AcMesh host_mesh,
365  const VertexBufferHandle vtxbuf_handle);
366 
368 AcResult acNodeLoadMesh(const Node node, const Stream stream, const AcMesh host_mesh);
369 
371 AcResult acNodeStoreVertexBufferWithOffset(const Node node, const Stream stream,
372  const VertexBufferHandle vtxbuf_handle, const int3 src,
373  const int3 dst, const int num_vertices,
374  AcMesh* host_mesh);
375 
377 AcResult acNodeStoreMeshWithOffset(const Node node, const Stream stream, const int3 src,
378  const int3 dst, const int num_vertices, AcMesh* host_mesh);
379 
381 AcResult acNodeStoreVertexBuffer(const Node node, const Stream stream,
382  const VertexBufferHandle vtxbuf_handle, AcMesh* host_mesh);
383 
385 AcResult acNodeStoreMesh(const Node node, const Stream stream, AcMesh* host_mesh);
386 
388 AcResult acNodeIntegrateSubstep(const Node node, const Stream stream, const int step_number,
389  const int3 start, const int3 end, const AcReal dt);
390 
392 AcResult acNodeIntegrate(const Node node, const AcReal dt);
393 
395 AcResult acNodePeriodicBoundcondStep(const Node node, const Stream stream,
396  const VertexBufferHandle vtxbuf_handle);
397 
399 AcResult acNodePeriodicBoundconds(const Node node, const Stream stream);
400 
402 AcResult acNodeReduceScal(const Node node, const Stream stream, const ReductionType rtype,
403  const VertexBufferHandle vtxbuf_handle, AcReal* result);
405 AcResult acNodeReduceVec(const Node node, const Stream stream_type, const ReductionType rtype,
406  const VertexBufferHandle vtxbuf0, const VertexBufferHandle vtxbuf1,
407  const VertexBufferHandle vtxbuf2, AcReal* result);
408 
409 /*
410  * =============================================================================
411  * Device interface
412  * =============================================================================
413  */
415 AcResult acDeviceCreate(const int id, const AcMeshInfo device_config, Device* device);
416 
419 
421 AcResult acDevicePrintInfo(const Device device);
422 
424 AcResult acDeviceAutoOptimize(const Device device);
425 
427 AcResult acDeviceSynchronizeStream(const Device device, const Stream stream);
428 
430 AcResult acDeviceSwapBuffers(const Device device);
431 
433 AcResult acDeviceLoadScalarUniform(const Device device, const Stream stream,
434  const AcRealParam param, const AcReal value);
435 
437 AcResult acDeviceLoadVectorUniform(const Device device, const Stream stream,
438  const AcReal3Param param, const AcReal3 value);
439 
441 AcResult acDeviceLoadIntUniform(const Device device, const Stream stream, const AcIntParam param,
442  const int value);
443 
445 AcResult acDeviceLoadInt3Uniform(const Device device, const Stream stream, const AcInt3Param param,
446  const int3 value);
447 
449 AcResult acDeviceLoadScalarArray(const Device device, const Stream stream,
450  const ScalarArrayHandle handle, const size_t start,
451  const AcReal* data, const size_t num);
452 
454 AcResult acDeviceLoadMeshInfo(const Device device, const AcMeshInfo device_config);
455 
458 
460 AcResult acDeviceLoadVertexBufferWithOffset(const Device device, const Stream stream,
461  const AcMesh host_mesh,
462  const VertexBufferHandle vtxbuf_handle, const int3 src,
463  const int3 dst, const int num_vertices);
464 
466 AcResult acDeviceLoadMeshWithOffset(const Device device, const Stream stream,
467  const AcMesh host_mesh, const int3 src, const int3 dst,
468  const int num_vertices);
469 
471 AcResult acDeviceLoadVertexBuffer(const Device device, const Stream stream, const AcMesh host_mesh,
472  const VertexBufferHandle vtxbuf_handle);
473 
475 AcResult acDeviceLoadMesh(const Device device, const Stream stream, const AcMesh host_mesh);
476 
478 AcResult acDeviceStoreVertexBufferWithOffset(const Device device, const Stream stream,
479  const VertexBufferHandle vtxbuf_handle, const int3 src,
480  const int3 dst, const int num_vertices,
481  AcMesh* host_mesh);
482 
484 AcResult acDeviceStoreMeshWithOffset(const Device device, const Stream stream, const int3 src,
485  const int3 dst, const int num_vertices, AcMesh* host_mesh);
486 
488 AcResult acDeviceStoreVertexBuffer(const Device device, const Stream stream,
489  const VertexBufferHandle vtxbuf_handle, AcMesh* host_mesh);
490 
492 AcResult acDeviceStoreMesh(const Device device, const Stream stream, AcMesh* host_mesh);
493 
495 AcResult acDeviceTransferVertexBufferWithOffset(const Device src_device, const Stream stream,
496  const VertexBufferHandle vtxbuf_handle,
497  const int3 src, const int3 dst,
498  const int num_vertices, Device dst_device);
499 
501 AcResult acDeviceTransferMeshWithOffset(const Device src_device, const Stream stream,
502  const int3 src, const int3 dst, const int num_vertices,
503  Device* dst_device);
504 
506 AcResult acDeviceTransferVertexBuffer(const Device src_device, const Stream stream,
507  const VertexBufferHandle vtxbuf_handle, Device dst_device);
508 
510 AcResult acDeviceTransferMesh(const Device src_device, const Stream stream, Device dst_device);
511 
513 AcResult acDeviceIntegrateSubstep(const Device device, const Stream stream, const int step_number,
514  const int3 start, const int3 end, const AcReal dt);
516 AcResult acDevicePeriodicBoundcondStep(const Device device, const Stream stream,
517  const VertexBufferHandle vtxbuf_handle, const int3 start,
518  const int3 end);
519 
521 AcResult acDevicePeriodicBoundconds(const Device device, const Stream stream, const int3 start,
522  const int3 end);
523 
525 AcResult acDeviceReduceScal(const Device device, const Stream stream, const ReductionType rtype,
526  const VertexBufferHandle vtxbuf_handle, AcReal* result);
528 AcResult acDeviceReduceVec(const Device device, const Stream stream_type, const ReductionType rtype,
529  const VertexBufferHandle vtxbuf0, const VertexBufferHandle vtxbuf1,
530  const VertexBufferHandle vtxbuf2, AcReal* result);
533 
534 #ifdef __cplusplus
535 } // extern "C"
536 #endif
acDeviceLoadScalarUniform
AcResult acDeviceLoadScalarUniform(const Device device, const Stream stream, const AcRealParam param, const AcReal value)
Definition: kernels.cu:100
acDeviceLoadMesh
AcResult acDeviceLoadMesh(const Device device, const Stream stream, const AcMesh host_mesh)
Definition: device.cc:273
acDeviceReduceVec
AcResult acDeviceReduceVec(const Device device, const Stream stream_type, const ReductionType rtype, const VertexBufferHandle vtxbuf0, const VertexBufferHandle vtxbuf1, const VertexBufferHandle vtxbuf2, AcReal *result)
Definition: device.cc:442
AC_GEN_STR
#define AC_GEN_STR(X)
Definition: astaroth.h:118
acDeviceLoadMeshWithOffset
AcResult acDeviceLoadMeshWithOffset(const Device device, const Stream stream, const AcMesh host_mesh, const int3 src, const int3 dst, const int num_vertices)
Definition: device.cc:248
acNodeReduceVec
AcResult acNodeReduceVec(const Node node, const Stream stream_type, const ReductionType rtype, const VertexBufferHandle vtxbuf0, const VertexBufferHandle vtxbuf1, const VertexBufferHandle vtxbuf2, AcReal *result)
Definition: node.cc:838
AC_FOR_VTXBUF_HANDLES
@ AC_FOR_VTXBUF_HANDLES
Definition: astaroth.h:112
acDeviceLoadIntUniform
AcResult acDeviceLoadIntUniform(const Device device, const Stream stream, const AcIntParam param, const int value)
Definition: kernels.cu:149
acDeviceStoreMeshWithOffset
AcResult acDeviceStoreMeshWithOffset(const Device device, const Stream stream, const int3 src, const int3 dst, const int num_vertices, AcMesh *host_mesh)
Definition: device.cc:303
acBoundcondStep
AcResult acBoundcondStep(void)
Definition: astaroth.cc:107
acIntegrateStep
AcResult acIntegrateStep(const int isubstep, const AcReal dt)
Definition: astaroth.cc:90
RTYPE_SUM
@ RTYPE_SUM
Definition: astaroth.h:58
acDevicePeriodicBoundconds
AcResult acDevicePeriodicBoundconds(const Device device, const Stream stream, const int3 start, const int3 end)
Definition: device.cc:412
acNodeSynchronizeVertexBuffer
AcResult acNodeSynchronizeVertexBuffer(const Node node, const Stream stream, const VertexBufferHandle vtxbuf_handle)
Definition: node.cc:385
acNodeStoreMesh
AcResult acNodeStoreMesh(const Node node, const Stream stream, AcMesh *host_mesh)
Definition: node.cc:606
AcResult
AcResult
Definition: astaroth.h:51
acSynchronizeStream
AcResult acSynchronizeStream(const Stream stream)
Definition: astaroth.cc:60
Grid
Definition: astaroth.h:147
STREAM_16
@ STREAM_16
Definition: astaroth.h:80
AC_FOR_USER_REAL_PARAM_TYPES
@ AC_FOR_USER_REAL_PARAM_TYPES
Definition: astaroth.h:97
acNodeStoreVertexBufferWithOffset
AcResult acNodeStoreVertexBufferWithOffset(const Node node, const Stream stream, const VertexBufferHandle vtxbuf_handle, const int3 src, const int3 dst, const int num_vertices, AcMesh *host_mesh)
Definition: node.cc:540
STREAM_12
@ STREAM_12
Definition: astaroth.h:76
acCheckDeviceAvailability
AcResult acCheckDeviceAvailability(void)
Definition: astaroth.cc:43
acSynchronize
AcResult acSynchronize(void)
Definition: astaroth.cc:54
acNodeLoadConstant
AcResult acNodeLoadConstant(const Node node, const Stream stream, const AcRealParam param, const AcReal value)
Definition: node.cc:451
STREAM_2
@ STREAM_2
Definition: astaroth.h:66
DeviceConfiguration::num_devices
int num_devices
Definition: astaroth.h:153
acNodeLoadMeshWithOffset
AcResult acNodeLoadMeshWithOffset(const Node node, const Stream stream, const AcMesh host_mesh, const int3 src, const int3 dst, const int num_vertices)
Definition: node.cc:507
STREAM_5
@ STREAM_5
Definition: astaroth.h:69
ReductionType
ReductionType
Definition: astaroth.h:53
acDeviceStoreVertexBuffer
AcResult acDeviceStoreVertexBuffer(const Device device, const Stream stream, const VertexBufferHandle vtxbuf_handle, AcMesh *host_mesh)
Definition: device.cc:316
acDeviceIntegrateSubstep
AcResult acDeviceIntegrateSubstep(const Device device, const Stream stream, const int step_number, const int3 start, const int3 end, const AcReal dt)
Definition: device.cc:393
AcMeshInfo::int_params
int int_params[NUM_INT_PARAMS]
Definition: astaroth.h:129
AC_FAILURE
@ AC_FAILURE
Definition: astaroth.h:51
node_s
Definition: node.cc:133
acNodeLoadVertexBuffer
AcResult acNodeLoadVertexBuffer(const Node node, const Stream stream, const AcMesh host_mesh, const VertexBufferHandle vtxbuf_handle)
Definition: node.cc:518
AC_FOR_USER_INT3_PARAM_TYPES
@ AC_FOR_USER_INT3_PARAM_TYPES
Definition: astaroth.h:92
acNodeReduceScal
AcResult acNodeReduceScal(const Node node, const Stream stream, const ReductionType rtype, const VertexBufferHandle vtxbuf_handle, AcReal *result)
Definition: node.cc:822
acNodeDestroy
AcResult acNodeDestroy(Node node)
Definition: node.cc:309
Grid::n
int3 n
Definition: astaroth.h:149
acNodeLoadMesh
AcResult acNodeLoadMesh(const Node node, const Stream stream, const AcMesh host_mesh)
Definition: node.cc:531
acDeviceReduceScal
AcResult acDeviceReduceScal(const Device device, const Stream stream, const ReductionType rtype, const VertexBufferHandle vtxbuf_handle, AcReal *result)
Definition: device.cc:422
AcReal
float AcReal
Definition: astaroth.h:38
acNodePrintInfo
AcResult acNodePrintInfo(const Node node)
Definition: node.cc:347
STREAM_7
@ STREAM_7
Definition: astaroth.h:71
Node
struct node_s * Node
Definition: astaroth.h:145
device_s
Definition: kernels.h:16
acReduceVec
AcReal acReduceVec(const ReductionType rtype, const VertexBufferHandle a, const VertexBufferHandle b, const VertexBufferHandle c)
Definition: astaroth.cc:121
acDeviceCreate
AcResult acDeviceCreate(const int id, const AcMeshInfo device_config, Device *device)
Definition: device.cc:106
acDeviceLoadVertexBufferWithOffset
AcResult acDeviceLoadVertexBufferWithOffset(const Device device, const Stream stream, const AcMesh host_mesh, const VertexBufferHandle vtxbuf_handle, const int3 src, const int3 dst, const int num_vertices)
Definition: device.cc:228
STREAM_4
@ STREAM_4
Definition: astaroth.h:68
AcInt3Param
AcInt3Param
Definition: astaroth.h:91
acNodeStoreMeshWithOffset
AcResult acNodeStoreMeshWithOffset(const Node node, const Stream stream, const int3 src, const int3 dst, const int num_vertices, AcMesh *host_mesh)
Definition: node.cc:581
AC_FOR_SCALARARRAY_HANDLES
@ AC_FOR_SCALARARRAY_HANDLES
Definition: astaroth.h:107
acLoad
AcResult acLoad(const AcMesh host_mesh)
Definition: astaroth.cc:72
RTYPE_MAX
@ RTYPE_MAX
Definition: astaroth.h:54
AC_SUCCESS
@ AC_SUCCESS
Definition: astaroth.h:51
acIntegrateStepWithOffset
AcResult acIntegrateStepWithOffset(const int isubstep, const AcReal dt, const int3 start, const int3 end)
Definition: astaroth.cc:101
acDeviceLoadScalarArray
AcResult acDeviceLoadScalarArray(const Device device, const Stream stream, const ScalarArrayHandle handle, const size_t start, const AcReal *data, const size_t num)
Definition: device.cc:210
DeviceConfiguration::subgrid
Grid subgrid
Definition: astaroth.h:157
acQuit
AcResult acQuit(void)
Definition: astaroth.cc:36
acReduceScal
AcReal acReduceScal(const ReductionType rtype, const VertexBufferHandle vtxbuf_handle)
Definition: astaroth.cc:113
AcMeshInfo::int3_params
int3 int3_params[NUM_INT3_PARAMS]
Definition: astaroth.h:130
STREAM_13
@ STREAM_13
Definition: astaroth.h:77
AcMatrix
Definition: astaroth.h:45
DeviceConfiguration::grid
Grid grid
Definition: astaroth.h:156
acNodePeriodicBoundconds
AcResult acNodePeriodicBoundconds(const Node node, const Stream stream)
Definition: node.cc:786
acDeviceSynchronizeStream
AcResult acDeviceSynchronizeStream(const Device device, const Stream stream)
Definition: device.cc:93
AcMeshInfo::real3_params
AcReal3 real3_params[NUM_REAL3_PARAMS]
Definition: astaroth.h:132
AcMeshInfo
Definition: astaroth.h:128
acDeviceLoadInt3Uniform
AcResult acDeviceLoadInt3Uniform(const Device device, const Stream stream, const AcInt3Param param, const int3 value)
Definition: kernels.cu:173
STREAM_14
@ STREAM_14
Definition: astaroth.h:78
acLoadDeviceConstant
AcResult acLoadDeviceConstant(const AcRealParam param, const AcReal value)
Definition: astaroth.cc:66
acDeviceLoadVertexBuffer
AcResult acDeviceLoadVertexBuffer(const Device device, const Stream stream, const AcMesh host_mesh, const VertexBufferHandle vtxbuf_handle)
Definition: device.cc:260
STREAM_DEFAULT
@ STREAM_DEFAULT
Definition: astaroth.h:63
acDevicePeriodicBoundcondStep
AcResult acDevicePeriodicBoundcondStep(const Device device, const Stream stream, const VertexBufferHandle vtxbuf_handle, const int3 start, const int3 end)
Definition: device.cc:402
DeviceConfiguration::devices
Device * devices
Definition: astaroth.h:154
NUM_STREAMS
@ NUM_STREAMS
Definition: astaroth.h:81
acNodeCreate
AcResult acNodeCreate(const int id, const AcMeshInfo node_config, Node *node)
Definition: node.cc:210
RTYPE_RMS_EXP
@ RTYPE_RMS_EXP
Definition: astaroth.h:57
Device
struct device_s * Device
Definition: astaroth.h:141
acNodeIntegrate
AcResult acNodeIntegrate(const Node node, const AcReal dt)
Definition: node.cc:693
STREAM_1
@ STREAM_1
Definition: astaroth.h:65
acNodePeriodicBoundcondStep
AcResult acNodePeriodicBoundcondStep(const Node node, const Stream stream, const VertexBufferHandle vtxbuf_handle)
Definition: node.cc:772
value
Preprocessed Scalar value(in ScalarField vertex)
Definition: stdderiv.h:218
AC_FOR_USER_REAL3_PARAM_TYPES
@ AC_FOR_USER_REAL3_PARAM_TYPES
Definition: astaroth.h:102
acNodeIntegrateSubstep
AcResult acNodeIntegrateSubstep(const Node node, const Stream stream, const int step_number, const int3 start, const int3 end, const AcReal dt)
Definition: node.cc:615
AcReal3Param
AcReal3Param
Definition: astaroth.h:101
acNodeAutoOptimize
AcResult acNodeAutoOptimize(const Node node)
Definition: node.cc:366
AcMesh::info
AcMeshInfo info
Definition: astaroth.h:137
acDeviceTransferMesh
AcResult acDeviceTransferMesh(const Device src_device, const Stream stream, Device dst_device)
Definition: device.cc:383
AC_GEN_ID
#define AC_GEN_ID(X)
Definition: astaroth.h:85
acDeviceLoadDefaultUniforms
AcResult acDeviceLoadDefaultUniforms(const Device device)
Definition: kernels.cu:228
acDeviceSwapBuffers
AcResult acDeviceSwapBuffers(const Device device)
Definition: device.cc:198
acDeviceAutoOptimize
AcResult acDeviceAutoOptimize(const Device device)
Definition: device.cc:76
acLoadWithOffset
AcResult acLoadWithOffset(const AcMesh host_mesh, const int3 src, const int num_vertices)
Definition: astaroth.cc:136
Grid::m
int3 m
Definition: astaroth.h:148
NUM_REDUCTION_TYPES
@ NUM_REDUCTION_TYPES
Definition: astaroth.h:59
acDeviceLoadMeshInfo
AcResult acDeviceLoadMeshInfo(const Device device, const AcMeshInfo device_config)
Definition: kernels.cu:199
VertexBufferHandle
VertexBufferHandle
Definition: astaroth.h:111
Stream
Stream
Definition: astaroth.h:62
acNodeQueryDeviceConfiguration
AcResult acNodeQueryDeviceConfiguration(const Node node, DeviceConfiguration *config)
Definition: node.cc:355
acDevicePrintInfo
AcResult acDevicePrintInfo(const Device device)
Definition: device.cc:16
acNodeSynchronizeStream
AcResult acNodeSynchronizeStream(const Node node, const Stream stream)
Definition: node.cc:374
acDeviceStoreVertexBufferWithOffset
AcResult acDeviceStoreVertexBufferWithOffset(const Device device, const Stream stream, const VertexBufferHandle vtxbuf_handle, const int3 src, const int3 dst, const int num_vertices, AcMesh *host_mesh)
Definition: device.cc:283
acNodeLoadVertexBufferWithOffset
AcResult acNodeLoadVertexBufferWithOffset(const Node node, const Stream stream, const AcMesh host_mesh, const VertexBufferHandle vtxbuf_handle, const int3 src, const int3 dst, const int num_vertices)
Definition: node.cc:463
DeviceConfiguration
Definition: astaroth.h:152
RTYPE_MIN
@ RTYPE_MIN
Definition: astaroth.h:55
AcReal3
float3 AcReal3
Definition: astaroth.h:39
STREAM_3
@ STREAM_3
Definition: astaroth.h:67
AC_FOR_USER_INT_PARAM_TYPES
@ AC_FOR_USER_INT_PARAM_TYPES
Definition: astaroth.h:87
STREAM_8
@ STREAM_8
Definition: astaroth.h:72
acDeviceDestroy
AcResult acDeviceDestroy(Device device)
Definition: device.cc:169
AcIntParam
AcIntParam
Definition: astaroth.h:86
acDeviceTransferMeshWithOffset
AcResult acDeviceTransferMeshWithOffset(const Device src_device, const Stream stream, const int3 src, const int3 dst, const int num_vertices, Device *dst_device)
acNodeStoreVertexBuffer
AcResult acNodeStoreVertexBuffer(const Node node, const Stream stream, const VertexBufferHandle vtxbuf_handle, AcMesh *host_mesh)
Definition: node.cc:592
acNodeSwapBuffers
AcResult acNodeSwapBuffers(const Node node)
Definition: node.cc:441
STREAM_0
@ STREAM_0
Definition: astaroth.h:64
acSynchronizeMesh
AcResult acSynchronizeMesh(void)
Definition: astaroth.cc:142
STREAM_11
@ STREAM_11
Definition: astaroth.h:75
STREAM_9
@ STREAM_9
Definition: astaroth.h:73
acNodeSynchronizeMesh
AcResult acNodeSynchronizeMesh(const Node node, const Stream stream)
Definition: node.cc:431
STREAM_6
@ STREAM_6
Definition: astaroth.h:70
ScalarArrayHandle
ScalarArrayHandle
Definition: astaroth.h:106
acStore
AcResult acStore(AcMesh *host_mesh)
Definition: astaroth.cc:78
acGetNumDevicesPerNode
int acGetNumDevicesPerNode(void)
Definition: astaroth.cc:148
acDeviceTransferVertexBufferWithOffset
AcResult acDeviceTransferVertexBufferWithOffset(const Device src_device, const Stream stream, const VertexBufferHandle vtxbuf_handle, const int3 src, const int3 dst, const int num_vertices, Device dst_device)
Definition: device.cc:340
_UNUSED
#define _UNUSED
Definition: astaroth.h:117
AcMeshInfo::real_params
AcReal real_params[NUM_REAL_PARAMS]
Definition: astaroth.h:131
STREAM_15
@ STREAM_15
Definition: astaroth.h:79
acInit
AcResult acInit(const AcMeshInfo mesh_info)
Definition: astaroth.cc:29
STREAM_10
@ STREAM_10
Definition: astaroth.h:74
acDeviceStoreMesh
AcResult acDeviceStoreMesh(const Device device, const Stream stream, AcMesh *host_mesh)
Definition: device.cc:330
acIntegrate
AcResult acIntegrate(const AcReal dt)
Definition: astaroth.cc:84
acDeviceTransferVertexBuffer
AcResult acDeviceTransferVertexBuffer(const Device src_device, const Stream stream, const VertexBufferHandle vtxbuf_handle, Device dst_device)
Definition: device.cc:370
acStoreWithOffset
AcResult acStoreWithOffset(const int3 dst, const size_t num_vertices, AcMesh *host_mesh)
Definition: astaroth.cc:130
acGetNode
Node acGetNode(void)
Definition: astaroth.cc:156
AcMesh
Definition: astaroth.h:135
acDeviceRunMPITest
AcResult acDeviceRunMPITest(void)
Definition: device.cc:1381
AcRealParam
AcRealParam
Definition: astaroth.h:96
acDeviceLoadVectorUniform
AcResult acDeviceLoadVectorUniform(const Device device, const Stream stream, const AcReal3Param param, const AcReal3 value)
Definition: kernels.cu:124
RTYPE_RMS
@ RTYPE_RMS
Definition: astaroth.h:56