#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "bmz-internal.h"
#include "test-helper.h"
#include <sys/mman.h>
Go to the source code of this file.
|
static void | dump_bm (const char *label, const char *in, size_t len) |
|
static void | test_bm_mod (const char *in, size_t len, char *out, size_t *len_p, void *work_mem) |
|
static void | test_bm_mod16x2 (const char *in, size_t len, char *out, size_t *len_p, void *work_mem) |
|
static void | test_bm_mask16x2 (const char *in, size_t len, char *out, size_t *len_p, void *work_mem) |
|
static void | test_bm_mask (const char *in, size_t len, char *out, size_t *len_p, void *work_mem) |
|
static void | test_bm_mask32x2 (const char *in, size_t len, char *out, size_t *len_p, void *work_mem) |
|
static void | test_bm_unpack (const char *in, size_t len, char *out, size_t *len_p) |
|
static char * | read_from_fp (FILE *fp, size_t *len_p) |
|
static void | print_hash (const char *label, size_t h) |
|
static void | show_hash (const char *data, size_t len) |
|
static void | test_from_string (const char *data, size_t len) |
|
static void | test_from_stdin () |
|
static void | test_from_file (const char *fname) |
|
static void | show_usage () |
|
int | main (int ac, char *av[]) |
|
#define BENCH |
( |
|
_label_, |
|
|
|
_code_, |
|
|
|
_n_, |
|
|
|
_times_ |
|
) |
| |
Value:do { \
printf("%16s: %.3fs (%.3fMB/s)\n", \
_label_, t1, (_n_) / 1e6 / t1 *(_times_)); \
fflush(stdout); fflush(stderr); \
} while (0)
#define TIMES(_n_, _code_)
#define HT_MEASURE(_t_, _code_)
Definition at line 46 of file bmz-test.c.
#define DIE |
( |
|
_fmt_, |
|
|
|
... |
|
) |
| |
Value:
LOG(0,
"fatal: " _fmt_, ##__VA_ARGS__); \
exit(1); \
} while (0)
#define LOG(_lvl_, _fmt_,...)
Definition at line 58 of file bmz-test.c.
#define LOG |
( |
|
_lvl_, |
|
|
|
_fmt_, |
|
|
|
... |
|
) |
| |
Value:
fprintf(stderr, "%s: " _fmt_ "\n", __FUNCTION__, ##__VA_ARGS__); \
} while(0)
Definition at line 54 of file bmz-test.c.
#define O_BENCH_HASH (1 << 0) |
#define O_BENCH_LUT (1 << 1) |
#define O_CHECK_HASH (1 << 2) |
#define O_DEFAULT (0xffffffff & ~O_CHECK_HASH) |
#define O_HASH_MASK (1 << 7) |
#define O_HASH_MASK16X2 (1 << 6) |
#define O_HASH_MASK32X2 (1 << 8) |
#define O_HASH_MOD (1 << 4) |
#define O_HASH_MOD16X2 (1 << 5) |
#define O_HASHES 0xfffffff0 |
#define O_MEMCPY (1 << 3) |
#define TIMES |
( |
|
_n_, |
|
|
|
_code_ |
|
) |
| |
Value:do { \
size_t _n = _n_; \
while (_n--) { _code_; } \
} while (0)
Definition at line 41 of file bmz-test.c.
static void dump_bm |
( |
const char * |
label, |
|
|
const char * |
in, |
|
|
size_t |
len |
|
) |
| |
|
static |
int main |
( |
int |
ac, |
|
|
char * |
av[] |
|
) |
| |
static void print_hash |
( |
const char * |
label, |
|
|
size_t |
h |
|
) |
| |
|
static |
static char* read_from_fp |
( |
FILE * |
fp, |
|
|
size_t * |
len_p |
|
) |
| |
|
static |
static void show_hash |
( |
const char * |
data, |
|
|
size_t |
len |
|
) |
| |
|
static |
static void show_usage |
( |
| ) |
|
|
static |
static void test_bm_mask |
( |
const char * |
in, |
|
|
size_t |
len, |
|
|
char * |
out, |
|
|
size_t * |
len_p, |
|
|
void * |
work_mem |
|
) |
| |
|
static |
static void test_bm_mask16x2 |
( |
const char * |
in, |
|
|
size_t |
len, |
|
|
char * |
out, |
|
|
size_t * |
len_p, |
|
|
void * |
work_mem |
|
) |
| |
|
static |
static void test_bm_mask32x2 |
( |
const char * |
in, |
|
|
size_t |
len, |
|
|
char * |
out, |
|
|
size_t * |
len_p, |
|
|
void * |
work_mem |
|
) |
| |
|
static |
static void test_bm_mod |
( |
const char * |
in, |
|
|
size_t |
len, |
|
|
char * |
out, |
|
|
size_t * |
len_p, |
|
|
void * |
work_mem |
|
) |
| |
|
static |
static void test_bm_mod16x2 |
( |
const char * |
in, |
|
|
size_t |
len, |
|
|
char * |
out, |
|
|
size_t * |
len_p, |
|
|
void * |
work_mem |
|
) |
| |
|
static |
static void test_bm_unpack |
( |
const char * |
in, |
|
|
size_t |
len, |
|
|
char * |
out, |
|
|
size_t * |
len_p |
|
) |
| |
|
static |
static void test_from_file |
( |
const char * |
fname | ) |
|
|
static |
static void test_from_stdin |
( |
| ) |
|
|
static |
static void test_from_string |
( |
const char * |
data, |
|
|
size_t |
len |
|
) |
| |
|
static |
size_t s_m2 = (0xffff - 4) |
|
static |
Copyright (C) 2007-2015 Hypertable, Inc.
This file is part of Hypertable.
Hypertable is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or any later version.
Hypertable is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Hypertable. If not, see http://www.gnu.org/licenses/
Definition at line 31 of file bmz-test.c.