2023-02-01 22:30:00 +09:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
/* Useful macros */
|
|
|
|
#define EXIT(status) \
|
|
|
|
do { \
|
|
|
|
exit(status); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define CHECK_ERROR(cond, fmt, ...) \
|
|
|
|
do { \
|
|
|
|
if (!(cond)) {\
|
|
|
|
printf(fmt "\n", ##__VA_ARGS__); \
|
|
|
|
EXIT(EXIT_FAILURE); \
|
|
|
|
} \
|
|
|
|
} while (false)
|
|
|
|
|
|
|
|
|
|
|
|
void print_usage_exit(int argc, char **argv);
|
|
|
|
void check_and_parse_args(int argc, char **argv);
|
|
|
|
double get_time();
|
|
|
|
void *read_binary(const char *filename, size_t *size);
|
2023-02-03 01:25:19 +09:00
|
|
|
void print_first_few_result(float *output, int print_max, double elapsed_time);
|