xref: /libCEED/include/ceed/jit-source/magma/magma-common-defs.h (revision d275d636ccaa61e594421fac80252590e7a77ccf)
1 // Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 
8 /// @file
9 /// Internal header for MAGMA backend common definitions
10 #pragma once
11 
12 #define MAGMA_DEVICE_SHARED(type, name) extern __shared__ type name[];
13 
14 #define MAGMA_MAXTHREADS_1D 128
15 #define MAGMA_MAXTHREADS_2D 128
16 #define MAGMA_MAXTHREADS_3D 64
17 
18 // Define macro for determining number of threads in y-direction for basis kernels
19 #define MAGMA_BASIS_NTCOL(x, maxt) (((maxt) < (x)) ? 1 : ((maxt) / (x)))
20 
21 // Define macro for computing the total threads in a block for use with __launch_bounds__()
22 #define MAGMA_BASIS_BOUNDS(x, maxt) (x * MAGMA_BASIS_NTCOL(x, maxt))
23