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
|