File: GB_ewise_shared_definitions.h

package info (click to toggle)
suitesparse 1%3A7.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 254,920 kB
  • sloc: ansic: 1,134,743; cpp: 46,133; makefile: 4,875; fortran: 2,087; java: 1,826; sh: 996; ruby: 725; python: 495; asm: 371; sed: 166; awk: 44
file content (56 lines) | stat: -rw-r--r-- 1,558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//------------------------------------------------------------------------------
// GB_ewise_shared_definitions.h: common macros for ewise kernels
//------------------------------------------------------------------------------

// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//------------------------------------------------------------------------------

// GB_ewise_shared_definitions.h provides default definitions for all ewise
// kernels, if the special cases have not been #define'd prior to #include'ing
// this file.  This file is shared by generic, factory, and both CPU and
// CUDA JIT kernels.

#include "include/GB_kernel_shared_definitions.h"

#ifndef GB_EWISE_SHARED_DEFINITIONS_H
#define GB_EWISE_SHARED_DEFINITIONS_H

// C(i,j) = op (aij,bij) ;
#ifndef GB_EWISEOP
#define GB_EWISEOP(Cx,p,aij,bij,i,j) GB_BINOP (Cx [p], aij, bij, i, j)
#endif

// Cx [p] = z
#ifndef GB_PUTC
#define GB_PUTC(z,Cx,p) Cx [p] = z
#endif

// 1 if operator is second
#ifndef GB_OP_IS_SECOND
#define GB_OP_IS_SECOND 0
#endif

// copy A(i,j) to C(i,j)
#ifndef GB_COPY_A_to_C
#define GB_COPY_A_to_C(Cx,pC,Ax,pA,A_iso) Cx [pC] = Ax [(A_iso) ? 0 : (pA)]
#endif

// copy B(i,j) to C(i,j)
#ifndef GB_COPY_B_to_C
#define GB_COPY_B_to_C(Cx,pC,Bx,pB,B_iso) Cx [pC] = Bx [(B_iso) ? 0 : (pB)]
#endif

// 1 if C and A have the same type
#ifndef GB_CTYPE_IS_ATYPE
#define GB_CTYPE_IS_ATYPE 1
#endif

// 1 if C and B have the same type
#ifndef GB_CTYPE_IS_BTYPE
#define GB_CTYPE_IS_BTYPE 1
#endif

#endif