File: GB_printf_kernels.h

package info (click to toggle)
suitesparse 1%3A7.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, 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 (76 lines) | stat: -rw-r--r-- 2,466 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//------------------------------------------------------------------------------
// GB_printf_kernels.h: definitions for printing from GraphBLAS
//------------------------------------------------------------------------------

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

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

#ifndef GB_PRINTF_KERNELS_H
#define GB_PRINTF_KERNELS_H

// return the length of a string, or 0 if the string is NULL
#define GB_STRLEN(s) ((s == NULL) ? 0 : strlen (s))

#define GB_STRING_MATCH(s,t) (strcmp (s,t) == 0)

// format strings, normally %llu and %lld, for uint64_t and int64_t values
#define GBu "%" PRIu64
#define GBd "%" PRId64

//------------------------------------------------------------------------------
// GBDUMP: print to stdout
//------------------------------------------------------------------------------

// print to the standard output, and flush the result.  No error check is done.
// This function is used for the BURBLE, and for debugging output.  JIT kernels
// do not BURBLE, but they can use GBDUMP for debugging.

// the JIT run time kernels use printf and flush directly from libc:
#undef  GBDUMP
#define GBDUMP(...)                                             \
{                                                               \
    printf (__VA_ARGS__) ; /* JIT kernels use libc printf */    \
    fflush (stdout) ;      /* JIT kernels use libc fflush */    \
}

//------------------------------------------------------------------------------
// GBPR: print to a file, or stdout if the file is NULL
//------------------------------------------------------------------------------

// print to a file f, or to stdout if f is NULL, and check the result.  This
// macro is used by all user-callable GxB_*print and GB_*check functions.
// The method is not used in any JIT run time kernel.

// JIT runtime kernels do not use these methods
#undef  GBPR
#define GBPR(...)

#undef  GBPR0
#define GBPR0(...)

#undef  GB_CHECK_MAGIC
#define GB_CHECK_MAGIC(object)

// JIT kernels cannot burble
#undef  GBURBLE
#define GBURBLE(...)

#undef  GB_BURBLE_DENSE
#define GB_BURBLE_DENSE(A,format)

#undef  GB_BURBLE_START
#define GB_BURBLE_START(func)

#undef  GB_BURBLE_END
#define GB_BURBLE_END

#undef  GB_BURBLE_N
#define GB_BURBLE_N(n,...)

#undef  GB_BURBLE_MATRIX
#define GB_BURBLE_MATRIX(A, ...)

#endif