Astaroth  3.1
Scalable Multi-GPU Stencil Computations
Loading...
Searching...
No Matches
acc_runtime.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2014-2026, Johannes Pekkila, Miikka Vaisala, Touko Puro.
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
21#include <stdbool.h>
22#include <stdio.h>
23
24#include "ac_mpi.h"
26#include "builtin_enums.h"
27#include "datatypes.h"
28#include "errchk.h"
29#include "func_define.h"
30
31// clang-format off
32#include "profiles_info.h"
33#include "scalar_reduce_buffer_defs.h"
34#include "user_built-in_constants.h"
35#include "user_defines.h"
36#include "user_input_typedefs.h"
37// clang-format on
38
39#if AC_RUNTIME_COMPILATION
40#include <dlfcn.h>
41#endif
42
43#ifndef AC_RUNTIME_SOURCE
44#include <string.h>
45
46#ifdef __cplusplus
47#include <type_traits>
48#endif
49#endif
50
51#ifdef __cplusplus
52#include "is_array_param.h"
53#include "is_comptime_param.h"
54#include "is_output_param.h"
55#endif
56
57#define AC_INDEX_ORDER(i,j,k,x,y,z) \
58 i + x*j + x*y*k
59
60#define DEVICE_INLINE __device__ __forceinline__
61
62#define AC_SIZE(arr) sizeof(arr)/sizeof(arr[0])
63
64// If using C++ or C at version 23 or higher.
65#if defined(__cplusplus) || (__STDC_VERSION__ >= 202311L)
66#define CONSTEXPR constexpr
67#define MAYBE_UNUSED [[maybe_unused]]
68#else
69#define CONSTEXPR
70#define MAYBE_UNUSED
71#endif
72
73typedef struct KernelReduceOutput {
75 AcType type;
77 AcReductionPostProcessingOp postprocess_op;
78 AcKernel kernel;
79#ifdef __cplusplus
80 bool operator==(const KernelReduceOutput& other) const
81 {
82 return (variable == other.variable) &&
83 (type == other.type) &&
84 (op == other.op) &&
85 (kernel == other.kernel);
86 }
87#endif
89
90
91typedef struct
92{
94 const AcReductionPostProcessingOp post_processing_op;
95 const AcKernel map_vtxbuf_single;
96 const AcKernel map_vtxbuf_vec;
97 const AcKernel map_vtxbuf_vec_scal;
98 const char* name;
100
101#define NUM_REDUCE_SCRATCHPADS (2)
102
103
104typedef struct {
105 Volume nn;
106 AcReal3 lengths;
107} AcGridInfo;
108
109
110typedef struct {
111#include "output_decl.h"
113
114
115typedef struct AcCompInfoLoaded {
116#include "comp_loaded_decl.h"
117#ifdef __cplusplus
118#include "loaded_info_access_operators.h"
119#endif
121
123#include "comp_loaded_decl.h"
124#ifdef __cplusplus
125#include "loaded_info_access_operators.h"
126#endif
128
129typedef struct AcCompInfoConfig{
130#include "comp_decl.h"
131#ifdef __cplusplus
132#include "comp_info_access_operators.h"
133#endif
135
141
142typedef struct AcMeshInfoLoaded {
143#include "info_loaded_decl.h"
144
145#ifdef __cplusplus
146#include "info_loaded_operator_decl.h"
147#endif
149
150
151typedef struct AcMeshInfoScalars {
152#include "device_mesh_info_decl.h"
154
155
156typedef struct AcMeshInfo {
157
158#include "device_mesh_info_decl.h"
159#include "array_decl.h"
160
165 const char* acc_compiler_path;
170
171#ifdef __cplusplus
172#include "info_access_operators.h"
173#endif
174} AcMeshInfo;
175
176typedef struct {
177#include "input_decl.h"
178} AcInputs;
179
180typedef struct {
181 AcReal* in[NUM_PROFILES+1];
182 AcReal* out[NUM_PROFILES+1];
184
185typedef struct {
186 void* in[NUM_VTXBUF_HANDLES];
187 void* out[NUM_VTXBUF_HANDLES];
188 AcComplex* complex_in[NUM_COMPLEX_FIELDS+1];
189 acKernelInputParams kernel_input_params;
194
195typedef struct {
196 AcReduceOp reals[NUM_REAL_SCRATCHPADS+1];
197 AcReduceOp ints[NUM_INT_OUTPUTS+1];
198#if AC_DOUBLE_PRECISION
199 AcReduceOp floats[NUM_FLOAT_OUTPUTS+1];
200#endif
202
203// FIXME(OM): The API for this lives in astaroth_helpers.h even though it
204// should probably live in the ACC runtime layer. For now this works but it is
205// quite intuitive.
206typedef struct AcBuffer{
208 size_t count;
211 #ifdef __cplusplus
212 const AcReal& operator[](const int index) {return data[index];}
213 #endif
214} AcBuffer;
215
223
224typedef struct {
225 //Auxiliary metadata
226 size_t counts[NUM_ALL_FIELDS];
227 size_t bytes[NUM_ALL_FIELDS];
228 AcMeshDims dims[NUM_ALL_FIELDS];
229 AcMeshDims profile_dims[NUM_PROFILES+1];
230 size_t profile_counts[NUM_PROFILES+1];
232 //All kernel parameters and memory allocated on the device
235
236#include "scalar_reduce_buffers_in_vba.h"
237
240
242
243typedef struct {
244 float time;
245 dim3 tpb;
247
248static UNUSED int3
249acGetFieldHalos(const AcMeshInfo info, const VertexBufferHandle vtxbuf)
250{
251
252 if( vtxbuf_compile_time_halos[vtxbuf].x != -1
253 && vtxbuf_compile_time_halos[vtxbuf].y != -1
254 && vtxbuf_compile_time_halos[vtxbuf].z != -1
255 )
256 {
257 return vtxbuf_compile_time_halos[vtxbuf];
258 }
259 return info.int3_params[vtxbuf_run_time_halos[vtxbuf]];
260}
261
263
265
266#if AC_MPI_ENABLED
267 FUNC_DEFINE(AcResult, acInitializeRuntimeMPI,(const int grid_pid, const int nprocs, AcMeasurementGatherFunc));
268#endif
269
270 FUNC_DEFINE(const AcKernel*, acGetKernels,());
271 FUNC_DEFINE(AcResult, acKernelFlush,(const cudaStream_t stream, AcReal* arr, const size_t n, const AcReal value));
272 FUNC_DEFINE(AcResult, acKernelFlushInt,(const cudaStream_t stream, int* arr, const size_t n, const int value));
273 FUNC_DEFINE(AcResult, acKernelFlushReal,(const cudaStream_t stream, AcReal* arr, const size_t n, const AcReal value));
274 FUNC_DEFINE(AcResult, acKernelFlushComplex,(const cudaStream_t stream, AcComplex* arr, const size_t n, const AcComplex value));
275 FUNC_DEFINE(AcResult, acKernelFlushFloat,(const cudaStream_t stream, float* arr, const size_t n, const float value));
276
277 FUNC_DEFINE(AcResult, acPreprocessScratchPad,(VertexBufferArray, const int variable, const AcType type,const AcReduceOp op));
279 FUNC_DEFINE(size_t,acGetRealScratchpadSize,(const size_t i));
280
282
283
285
289
291
292 FUNC_DEFINE(AcResult, acRandInitAlt,(const uint64_t seed, const size_t count, const size_t rank));
293
294 FUNC_DEFINE(void, acRandQuit,(void));
295
296 FUNC_DEFINE(AcResult, acLaunchKernel,(AcKernel func, const cudaStream_t stream, const Volume start, const Volume end, VertexBufferArray));
297 FUNC_DEFINE(AcResult, acLaunchKernelWithTPB,(AcKernel kernel, const cudaStream_t stream, const Volume start_volume, const Volume end_volume, VertexBufferArray vba, const dim3 tpb));
298 FUNC_DEFINE(AcResult, acLaunchKernelBase,(const AcKernel kernel, const int3 start, const int3 end, VertexBufferArray vba, const dim3 bpg, const dim3 tpb, const size_t smem, const cudaStream_t stream, bool perform_error_check));
299
300
301 FUNC_DEFINE(AcResult, acSetReduceOffset,(AcKernel func, const Volume start, const Volume end, VertexBufferArray));
302
303 FUNC_DEFINE(AcResult, acBenchmarkKernel,(AcKernel kernel, const int3 start, const int3 end, VertexBufferArray vba));
304
305 FUNC_DEFINE(int3, acGetOptimTPB,(const AcKernel, const Volume start, const Volume end));
306
308 FUNC_DEFINE(AcResult, acLoadStencil,(const Stencil stencil, const cudaStream_t stream, const AcReal data[STENCIL_DEPTH][STENCIL_HEIGHT][STENCIL_WIDTH]));
309
311 FUNC_DEFINE(AcResult, acStoreStencil,(const Stencil stencil, const cudaStream_t stream, AcReal data[STENCIL_DEPTH][STENCIL_HEIGHT][STENCIL_WIDTH]));
312
313
315#include "load_and_store_uniform_header.h"
316
317 // Diagnostics
319
320 FUNC_DEFINE(AcKernel, acGetOptimizedKernel,(const AcKernel, const acKernelInputParams vba));
321
322 FUNC_DEFINE(int, acGetKernelReduceScratchPadSize,(const AcKernel kernel));
323
328
329static UNUSED size_t
330prof_count(const Profile prof, const size3_t counts)
331{
332 if(NUM_PROFILES == 0) return 0;
333 return
334 prof_types[prof] == PROFILE_X ? counts.x :
335 prof_types[prof] == PROFILE_Y ? counts.y :
336 prof_types[prof] == PROFILE_Z ? counts.z :
337 prof_types[prof] == PROFILE_XY ? counts.x*counts.y :
338 prof_types[prof] == PROFILE_XZ ? counts.x*counts.z :
339 prof_types[prof] == PROFILE_YX ? counts.y*counts.x :
340 prof_types[prof] == PROFILE_YZ ? counts.y*counts.z :
341 prof_types[prof] == PROFILE_ZX ? counts.z*counts.x :
342 prof_types[prof] == PROFILE_ZY ? counts.z*counts.y :
343 0;
344}
345static UNUSED size_t
346prof_size(const Profile prof, const size3_t counts)
347{
348 return prof_count(prof,counts)*sizeof(AcReal);
349}
350
352
353#ifdef __cplusplus
354#if AC_RUNTIME_COMPILATION
355#else
357acKernelFlush(const cudaStream_t stream, AcReal* arr, const size_t n,
358 const AcReal value);
359
361acKernelFlush(const cudaStream_t stream, int* arr, const size_t n,
362 const int value);
364acKernelFlush(const cudaStream_t stream, AcComplex* arr, const size_t n,
365 const AcComplex value);
366
367#if AC_DOUBLE_PRECISION
369acKernelFlush(const cudaStream_t stream, float* arr, const size_t n,
370 const float value);
371#endif
372#endif
373#ifndef AC_RUNTIME_SOURCE
374#include "load_comp_info.h"
375
376
378
379void acVBASwapBuffer(const Field field, VertexBufferArray* vba);
380
381void acVBASwapBuffers(VertexBufferArray* vba);
382
383void acPBASwapBuffer(const Profile profile, VertexBufferArray* vba);
384
385void acPBASwapBuffers(VertexBufferArray* vba);
386
387AcResult acLoadMeshInfo(const AcMeshInfo info, const cudaStream_t stream);
388
389FUNC_DEFINE(AcResult, acLoadRealReduceRes,(cudaStream_t stream, const AcRealOutputParam param, const AcReal* value));
390FUNC_DEFINE(AcResult, acLoadIntReduceRes,(cudaStream_t stream, const AcIntOutputParam param, const int* value));
391
392#if AC_DOUBLE_PRECISION
393FUNC_DEFINE(AcResult, acLoadFloatReduceRes,(cudaStream_t stream, const AcFloatOutputParam param, const float* value));
394#endif
395
396
397FUNC_DEFINE(AcResult, acPBAReset,(const cudaStream_t stream, ProfileBufferArray* pba, const AcMeshDims* dims));
398
399FUNC_DEFINE(ProfileBufferArray, acPBACreate,(const size3_t count));
400
401FUNC_DEFINE(void, acPBADestroy,(ProfileBufferArray* pba, const AcMeshDims* dims));
406FUNC_DEFINE(int, acVerifyMeshInfo,(const AcMeshInfo info));
407
409
410#ifdef __cplusplus
411
412#define GEN_LOAD_COMP_INFO(PARAM_TYPE,VAL_TYPE,TYPE) \
413 static AcResult __attribute__((unused)) acLoadCompInfo(const PARAM_TYPE param, const VAL_TYPE val, AcCompInfo* info) {return acLoad##TYPE##CompInfo(param,val,info);};
414#include "load_comp_info_overloads.h"
415#include "load_ac_kernel_params_def.h"
416
417#endif
418
419 template <typename P>
420 constexpr static array_info
421 get_array_info(const P array)
422 {
423#include "get_array_info.h"
424 ERRCHK_ALWAYS(false); //did not find array info
425 return (array_info){};
426 }
427
428 static UNUSED const char*
429 get_name(const AcRealOutputParam& param)
430 {
431 if constexpr(NUM_REAL_OUTPUTS == 0) return "NO REAL OUTPUTS";
432 return real_output_names[param];
433 }
434 static UNUSED const char*
435 get_name(const AcIntOutputParam& param)
436 {
437 if constexpr(NUM_INT_OUTPUTS == 0) return "NO INT OUTPUTS";
438 else return int_output_names[param];
439 }
440#if AC_DOUBLE_PRECISION
441 static UNUSED const char*
442 get_name(const AcFloatOutputParam& param)
443 {
444 if constexpr(NUM_FLOAT_OUTPUTS == 0) return "NO FLOAT OUTPUTS";
445 else return float_output_names[param];
446 }
447#endif
448
449 static UNUSED const char*
450 get_name(const Profile& param)
451 {
452 if constexpr(NUM_PROFILES==0) return "NO_PROFILES";
453 else return profile_names[param];
454 }
455
456 static UNUSED const char*
457 get_name(const Field& param)
458 {
459 return field_names[param];
460 }
461
462 template <typename P>
463 constexpr const char*
464 get_array_name(const P array)
465 {
466 return get_array_info(array).name;
467 }
468
469 template <typename P>
470 constexpr const char*
471 get_param_name(const P param)
472 {
473#include "get_param_name.h"
474 //ERRCHK_ALWAYS(false); //did not find name
475 return "NOT FOUND!";
476 }
477
478
479 template <typename P>
480 constexpr static const char*
481 get_name(const P param)
482 {
483 if constexpr (IsArrayParam(param)) return get_array_name(param);
484 else return get_param_name(param);
485 }
486
487 template <typename P>
488 constexpr static bool
489 is_dconst(const P array)
490 {
491 return get_array_info(array).is_dconst;
492 }
493
494 template <typename P>
495 constexpr static bool
496 is_alive(const P array)
497 {
498 return get_array_info(array).is_alive;
499 }
500
501 template <typename P>
502 constexpr static bool
503 is_accessed(const P array)
504 {
505 return get_array_info(array).is_accessed;
506 }
507
508
509 template <typename P>
510 constexpr static auto
511 get_array_dims(const P array)
512 {
513 return get_array_info(array).dims;
514 }
515
516 template <typename P>
517 constexpr static bool
518 has_const_dims(const P array)
519 {
520 auto dims = get_array_dims(array);
521 int num_dims = get_array_info(array).num_dims;
522 bool res = true;
523 for(int i = 0; i < num_dims; ++i)
524 res &= !dims[i].from_config;
525 return res;
526 }
527
528 template <typename P>
529 constexpr static int
530 get_array_n_dims(const P array)
531 {
532 return get_array_info(array).num_dims;
533 }
534
535 template <typename P>
536 constexpr static int
537 get_const_dims_array_length(const P array)
538 {
539 auto dims = get_array_info(array).dims;
540 int num_dims = get_array_info(array).num_dims;
541 int res = 1;
542 for(int i = 0; i < num_dims; ++i)
543 res *= dims[i].base;
544 return res;
545 }
546
547 template <typename P>
548 constexpr static auto
549 get_array_dim_sizes(const P array, const AcMeshInfo info)
550 {
551 auto dims = get_array_info(array).dims;
552 int num_dims = get_array_info(array).num_dims;
553 std::array<size_t,20> res{};
554 for(int i = 0; i < num_dims; ++i)
555 {
556 if(!dims[i].from_config)
557 {
558 res[i] = dims[i].base;
559 continue;
560 }
561 if(dims[i].member == NULL)
562 {
563 if(dims[i].run_const)
564 {
565 res[i] = info.run_consts.config.int_params[dims[i].base];
566 }
567 else
568 {
569 res[i] = info.int_params[dims[i].base];
570 }
571 continue;
572 }
573 if(!strcmp(dims[i].member,"x"))
574 {
575 res[i] = info.int3_params[dims[i].base].x;
576 continue;
577 }
578 if(!strcmp(dims[i].member,"y"))
579 {
580 res[i] = info.int3_params[dims[i].base].y;
581 continue;
582 }
583 if(!strcmp(dims[i].member,"z"))
584 {
585 res[i] = info.int3_params[dims[i].base].z;
586 continue;
587 }
588 }
589 return res;
590 }
591
592 template <typename P>
593 constexpr static size_t
594 get_array_length(const P array, const AcMeshInfo info)
595 {
596 auto sizes = get_array_dim_sizes(array,info);
597 size_t res = 1;
598 int num_dims = get_array_info(array).num_dims;
599 for(int i = 0; i < num_dims; ++i)
600 res *= sizes[i];
601 return res;
602 }
603
604 template <typename P>
605 constexpr static int
606 get_dconst_array_length(const P array)
607 {
608 return get_array_info(array).length;
609 }
610
611 template <typename P>
612 static int
613 get_dconst_array_offset(const P array)
614 {
615 return get_array_info(array).d_offset;
616 }
617
618 template <typename P>
619 constexpr static size_t
620 get_num_params()
621 {
622 const int res=
623#include "get_num_params.h"
624 -1;
625 static_assert(res >= 0);
626 return res;
627 }
628
629 // Helper to generate a sequence of integers at compile-time
630 template<std::size_t... Is>
631 constexpr std::array<int, sizeof...(Is)> make_array(std::index_sequence<Is...>) {
632 return {{ Is... }};
633 }
634
635 // Function to create an array of integers from 0 to N-1
636 template<std::size_t N>
637 constexpr std::array<int, N> createIntArray() {
638 return make_array(std::make_index_sequence<N>{});
639 }
640
641 // Function to create an array of enums from an array of integers
642 template<typename P, std::size_t N, std::size_t... Is>
643 constexpr std::array<P, N> createEnumArrayImpl(const std::array<int, N>& intArray, std::index_sequence<Is...>) {
644 return {{ static_cast<P>(intArray[Is])... }};
645 }
646
647 template<typename P, std::size_t N>
648 constexpr std::array<P, N> createEnumArray(const std::array<int, N>& intArray) {
649 return createEnumArrayImpl<P>(intArray, std::make_index_sequence<N>{});
650 }
651
652 template <typename P>
653 constexpr auto
654 get_params()
655 {
656 return createEnumArray<P>(
657 createIntArray<get_num_params<P>()>()
658 );
659 }
660 constexpr auto
661 get_vtxbuf_handles()
662 {
663 return createEnumArray<Field>(createIntArray<NUM_VTXBUF_HANDLES>());
664 }
665
666
667 template <typename P>
668 constexpr auto
669 get_empty_pointer(const P param)
670 {
671 (void)param;
672#include "get_empty_pointer.h"
673 }
674
675
676
677#include "load_and_store_uniform_overloads.h"
678
679 template<typename T, typename... Ts>
680 struct ForEach
681 {
682 template<template<typename> typename F, typename... Args>
683 static constexpr void run(Args&&... args)
684 {
685 ForEach<T>::template run<F>(std::forward<Args>(args)...);
686 ForEach<Ts...>::template run<F>(std::forward<Args>(args)...);
687 }
688 };
689
690 template<typename T>
691 struct ForEach<T>
692 {
693 template<template<typename> typename F, typename... Args>
694 static constexpr void run(Args&&... args)
695 {
696 F<T>{}(std::forward<Args>(args)...);
697 }
698 };
699
700
701 using AcScalarTypes = ForEach<
702#include "scalar_types.h"
703 AcIntParam
704 >;
705
706 using AcScalarCompTypes = ForEach<
707#include "scalar_comp_types.h"
708 AcIntCompParam
709 >;
710
711
712 using AcArrayTypes = ForEach<
713#include "array_types.h"
714 AcIntArrayParam
715 >;
716
717 using AcArrayCompTypes = ForEach<
718#include "array_comp_types.h"
719 AcIntCompArrayParam
720 >;
721
722#endif
723 #endif
AcResult acUpdateArrays(const AcMeshInfo config)
AcResult acRuntimeQuit()
AcResult acBenchmarkKernel(AcKernel kernel, const int3 start, const int3 end, VertexBufferArray vba)
AcResult acKernelFlushFloat(const cudaStream_t stream, float *arr, const size_t n, const float value)
AcResult acLoadStencil(const Stencil stencil, const cudaStream_t stream, const AcReal data[STENCIL_DEPTH][STENCIL_HEIGHT][STENCIL_WIDTH])
const AcKernel * acGetKernels()
void acRandQuit(void)
AcResult acLaunchKernel(AcKernel func, const cudaStream_t stream, const Volume start, const Volume end, VertexBufferArray)
AcResult acPreprocessScratchPad(VertexBufferArray, const int variable, const AcType type, const AcReduceOp op)
AcResult acKernelFlushComplex(const cudaStream_t stream, AcComplex *arr, const size_t n, const AcComplex value)
int acGetKernelReduceScratchPadMinSize()
AcResult acVBAReset(const cudaStream_t stream, VertexBufferArray *vba)
void acVBADestroy(VertexBufferArray *vba, const AcMeshInfo config)
Volume acKernelLaunchGetLastTPB(void)
bool acRuntimeIsInitialized()
AcResult acAllocateArrays(const AcMeshInfo config)
size_t acGetRealScratchpadSize(const size_t i)
AcResult acSetReduceOffset(AcKernel func, const Volume start, const Volume end, VertexBufferArray)
AcAutotuneMeasurement(* AcMeasurementGatherFunc)(const AcAutotuneMeasurement)
Definition acc_runtime.h:262
int acGetKernelReduceScratchPadSize(const AcKernel kernel)
AcResult acKernelFlush(const cudaStream_t stream, AcReal *arr, const size_t n, const AcReal value)
size3_t acGetProfileReduceScratchPadDims(const int profile, const AcMeshDims dims)
AcKernel acGetOptimizedKernel(const AcKernel, const acKernelInputParams vba)
VertexBufferArray acVBACreate(const AcMeshInfo config)
AcResult acKernelFlushInt(const cudaStream_t stream, int *arr, const size_t n, const int value)
AcResult acKernelFlushReal(const cudaStream_t stream, AcReal *arr, const size_t n, const AcReal value)
AcResult acRuntimeInit(const AcMeshInfo config)
AcResult acLaunchKernelWithTPB(AcKernel kernel, const cudaStream_t stream, const Volume start_volume, const Volume end_volume, VertexBufferArray vba, const dim3 tpb)
AcResult acRandInitAlt(const uint64_t seed, const size_t count, const size_t rank)
AcResult acInitializeRuntimeMPI(const int grid_pid, const int nprocs, AcMeasurementGatherFunc)
AcResult acStoreStencil(const Stencil stencil, const cudaStream_t stream, AcReal data[STENCIL_DEPTH][STENCIL_HEIGHT][STENCIL_WIDTH])
int3 acGetOptimTPB(const AcKernel, const Volume start, const Volume end)
AcResult acLaunchKernelBase(const AcKernel kernel, const int3 start, const int3 end, VertexBufferArray vba, const dim3 bpg, const dim3 tpb, const size_t smem, const cudaStream_t stream, bool perform_error_check)
AcResult acFreeArrays(const AcMeshInfo config)
float AcReal
Definition acreal.h:11
static const Stream stream
Definition astaroth_device.h:187
AcResult AcMeshInfo * config
Definition astaroth_utils.h:113
Brief info.
#define ERRCHK_ALWAYS(retval)
Definition errchk.h:95
#define UNUSED
Definition func_attributes.h:4
#define AC_BEGIN_C_DECLARATIONS
Definition func_define.h:14
#define AC_END_C_DECLARATIONS
Definition func_define.h:15
#define FUNC_DEFINE(return_type, func_name,...)
Definition func_define.h:69
#define cudaStream_t
Definition hip.h:25
Volume size3_t
Definition host_datatypes.h:76
AcResult
Definition host_datatypes.h:10
AcReduceOp
Definition host_datatypes.h:26
@ PROFILE_ZY
Definition host_datatypes.h:45
@ PROFILE_YX
Definition host_datatypes.h:42
@ PROFILE_XZ
Definition host_datatypes.h:41
@ PROFILE_Z
Definition host_datatypes.h:39
@ PROFILE_Y
Definition host_datatypes.h:38
@ PROFILE_YZ
Definition host_datatypes.h:43
@ PROFILE_XY
Definition host_datatypes.h:40
@ PROFILE_ZX
Definition host_datatypes.h:44
@ PROFILE_X
Definition host_datatypes.h:37
AcMeshOrder
Definition host_datatypes.h:17
Definition acc_runtime.h:243
dim3 tpb
Definition acc_runtime.h:245
float time
Definition acc_runtime.h:244
Definition acc_runtime.h:206
bool on_device
Definition acc_runtime.h:209
size_t count
Definition acc_runtime.h:208
AcReal * data
Definition acc_runtime.h:207
AcShape shape
Definition acc_runtime.h:210
Definition ac_mpi.h:36
Definition acc_runtime.h:129
Definition acc_runtime.h:122
Definition acc_runtime.h:115
Definition acc_runtime.h:136
AcCompInfoConfig config
Definition acc_runtime.h:137
AcCompInfoLoaded is_loaded
Definition acc_runtime.h:138
AcCompInfoHasDefaultValue has_default_value
Definition acc_runtime.h:139
Definition acc_runtime.h:110
Definition acc_runtime.h:104
Volume nn
Definition acc_runtime.h:105
AcReal3 lengths
Definition acc_runtime.h:106
Definition acc_runtime.h:176
Definition host_datatypes.h:84
Definition acc_runtime.h:142
Definition acc_runtime.h:151
Definition acc_runtime.h:156
bool runtime_compilation_skip_autotuning
Definition acc_runtime.h:167
const char * runtime_compilation_build_path
Definition acc_runtime.h:163
const char * runtime_compilation_log_dst
Definition acc_runtime.h:162
const char * runtime_compilation_base_path
Definition acc_runtime.h:164
AcCompInfo run_consts
Definition acc_runtime.h:169
AcCommunicator * comm
Definition acc_runtime.h:168
const char * acc_compiler_path
Definition acc_runtime.h:165
AcMeshInfoLoadedInfo is_loaded
Definition acc_runtime.h:161
bool runtime_compilation_skip_make_if_nothing_has_changed
Definition acc_runtime.h:166
Definition acc_runtime.h:216
AcMeshOrder mem_order
Definition acc_runtime.h:219
AcBuffer src
Definition acc_runtime.h:217
AcReal ** cub_tmp
Definition acc_runtime.h:220
AcBuffer transposed
Definition acc_runtime.h:218
size_t * cub_tmp_size
Definition acc_runtime.h:221
Definition acc_runtime.h:92
const AcReduceOp reduce_op
Definition acc_runtime.h:93
const char * name
Definition acc_runtime.h:98
const AcKernel map_vtxbuf_single
Definition acc_runtime.h:95
const AcKernel map_vtxbuf_vec
Definition acc_runtime.h:96
const AcReductionPostProcessingOp post_processing_op
Definition acc_runtime.h:94
const AcKernel map_vtxbuf_vec_scal
Definition acc_runtime.h:97
Definition acc_runtime.h:195
AcReduceOp reals[NUM_REAL_SCRATCHPADS+1]
Definition acc_runtime.h:196
AcReduceOp ints[NUM_INT_OUTPUTS+1]
Definition acc_runtime.h:197
Definition host_datatypes.h:48
Definition acc_runtime.h:185
int reduce_offset
Definition acc_runtime.h:190
void * out[NUM_VTXBUF_HANDLES]
Definition acc_runtime.h:187
int3 block_factor
Definition acc_runtime.h:192
void * in[NUM_VTXBUF_HANDLES]
Definition acc_runtime.h:186
acKernelInputParams kernel_input_params
Definition acc_runtime.h:189
ProfileBufferArray profiles
Definition acc_runtime.h:191
AcComplex * complex_in[NUM_COMPLEX_FIELDS+1]
Definition acc_runtime.h:188
Definition acc_runtime.h:73
int variable
Definition acc_runtime.h:74
AcReductionPostProcessingOp postprocess_op
Definition acc_runtime.h:77
AcReduceOp op
Definition acc_runtime.h:76
AcKernel kernel
Definition acc_runtime.h:78
AcType type
Definition acc_runtime.h:75
Definition acc_runtime.h:180
AcReal * out[NUM_PROFILES+1]
Definition acc_runtime.h:182
AcReal * in[NUM_PROFILES+1]
Definition acc_runtime.h:181
Definition acc_runtime.h:224
DeviceVertexBufferArray on_device
Definition acc_runtime.h:233
size_t profile_counts[NUM_PROFILES+1]
Definition acc_runtime.h:230
size_t profile_count
Definition acc_runtime.h:234
AcMeshDims dims[NUM_ALL_FIELDS]
Definition acc_runtime.h:228
size_t bytes[NUM_ALL_FIELDS]
Definition acc_runtime.h:227
AcMeshDims profile_dims[NUM_PROFILES+1]
Definition acc_runtime.h:229
size_t counts[NUM_ALL_FIELDS]
Definition acc_runtime.h:226
AcReduceBuffer profile_reduce_buffers[NUM_PROFILES+1]
Definition acc_runtime.h:239
AcScratchpadStates * scratchpad_states
Definition acc_runtime.h:238
AcMeshDims computational_dims
Definition acc_runtime.h:231
static __device__ const int dims
Definition user_kernel.h:128
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