1 // Copyright (c) 2017-2024, 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 #ifndef CEED_MAGMA_COMMON_DEFS_H 11 #define CEED_MAGMA_COMMON_DEFS_H 12 13 #define MAGMA_DEVICE_SHARED(type, name) extern __shared__ type name[]; 14 15 #define MAGMA_MAXTHREADS_1D 128 16 #define MAGMA_MAXTHREADS_2D 128 17 #define MAGMA_MAXTHREADS_3D 64 18 19 // Define macro for determining number of threads in y-direction for basis kernels 20 #define MAGMA_BASIS_NTCOL(x, maxt) (((maxt) < (x)) ? 1 : ((maxt) / (x))) 21 22 // Define macro for computing the total threads in a block for use with __launch_bounds__() 23 #define MAGMA_BASIS_BOUNDS(x, maxt) (x * MAGMA_BASIS_NTCOL(x, maxt)) 24 25 #endif // CEED_MAGMA_COMMON_DEFS_H 26