ceed.c (60f9e2d6e4644aed5c818838050a6aeac7d17af3) ceed.c (fc6bbced940bdfff573ee2079e5cb2caff7bebe9)
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

--- 191 unchanged lines hidden (view full) ---

200 @brief Print Ceed debugging information
201
202 @param ceed Ceed context
203 @param format Printing format
204
205 @return None
206
207 @ref Backend
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

--- 191 unchanged lines hidden (view full) ---

200 @brief Print Ceed debugging information
201
202 @param ceed Ceed context
203 @param format Printing format
204
205 @return None
206
207 @ref Backend
208**/
208**/
209// LCOV_EXCL_START
209void CeedDebugImpl(const Ceed ceed, const char *format,...) {
210 if (!ceed->debug) return;
211 va_list args;
212 va_start(args, format);
213 CeedDebugImpl256(ceed, 0, format, args);
214 va_end(args);
215}
210void CeedDebugImpl(const Ceed ceed, const char *format,...) {
211 if (!ceed->debug) return;
212 va_list args;
213 va_start(args, format);
214 CeedDebugImpl256(ceed, 0, format, args);
215 va_end(args);
216}
217// LCOV_EXCL_STOP
216
217/**
218 @brief Print Ceed debugging information in color
219
220 @param ceed Ceed context
221 @param color Color to print
222 @param format Printing format
223
224 @return None
225
226 @ref Backend
218
219/**
220 @brief Print Ceed debugging information in color
221
222 @param ceed Ceed context
223 @param color Color to print
224 @param format Printing format
225
226 @return None
227
228 @ref Backend
227**/
229**/
230// LCOV_EXCL_START
228void CeedDebugImpl256(const Ceed ceed, const unsigned char color,
229 const char *format,...) {
230 if (!ceed->debug) return;
231 va_list args;
232 va_start(args, format);
233 fflush(stdout);
234 fprintf(stdout, "\033[38;5;%dm", color);
235 vfprintf(stdout, format, args);
236 fprintf(stdout, "\033[m");
237 fprintf(stdout, "\n");
238 fflush(stdout);
239 va_end(args);
240}
231void CeedDebugImpl256(const Ceed ceed, const unsigned char color,
232 const char *format,...) {
233 if (!ceed->debug) return;
234 va_list args;
235 va_start(args, format);
236 fflush(stdout);
237 fprintf(stdout, "\033[38;5;%dm", color);
238 vfprintf(stdout, format, args);
239 fprintf(stdout, "\033[m");
240 fprintf(stdout, "\n");
241 fflush(stdout);
242 va_end(args);
243}
244// LCOV_EXCL_STOP
241
242/**
243 @brief Allocate an array on the host; use CeedMalloc()
244
245 Memory usage can be tracked by the library. This ensures sufficient
246 alignment for vectorization and should be used for large allocations.
247
248 @param n Number of units to allocate

--- 678 unchanged lines hidden ---
245
246/**
247 @brief Allocate an array on the host; use CeedMalloc()
248
249 Memory usage can be tracked by the library. This ensures sufficient
250 alignment for vectorization and should be used for large allocations.
251
252 @param n Number of units to allocate

--- 678 unchanged lines hidden ---