xref: /libCEED/rust/libceed-sys/c-src/include/ceed/jit-source/magma/magma-common-defs.h (revision f80f4a748154eed4bc661c135f695b92b1bc45b9)
1 // Copyright (c) 2017-2022, 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 #ifndef CEED_MAGMA_COMMON_DEFS_H
9 #define CEED_MAGMA_COMMON_DEFS_H
10 
11 #ifdef CEED_MAGMA_USE_HIP
12 #define MAGMA_DEVICE_SHARED(type, name) HIP_DYNAMIC_SHARED(type, name)
13 #else
14 #define MAGMA_DEVICE_SHARED(type, name) extern __shared__ type name[];
15 #endif
16 
17 typedef enum { MagmaNoTrans = 111, MagmaTrans = 112, MagmaConjTrans = 113, Magma_ConjTrans = MagmaConjTrans } magma_trans_t;
18 
19 #define MAGMA_D_ZERO 0.0
20 #define MAGMA_D_ONE 1.0
21 
22 #define MAGMA_CEILDIV(A, B) (((A) + (B)-1) / (B))
23 #define MAGMA_ROUNDUP(A, B) MAGMA_CEILDIV((A), (B)) * (B)
24 #define MAGMA_MAX(A, B) ((A) > (B) ? (A) : (B))
25 
26 #endif  // CEED_MAGMA_COMMON_DEFS_H
27