Skip to content

Commit

Permalink
Add Snappy-CUDA compression enum to the compression filter set and en…
Browse files Browse the repository at this point in the history
…able it in write
  • Loading branch information
skyFzz committed Aug 8, 2024
1 parent 05a0286 commit b09c584
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions commons/h5bench_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ char* compress_filter_names[] = {
"SZIP",
"GZIP",
"SZ3",
"ZFP"
"ZFP",
"SNAPPY-CUDA"
};

int compress_filter_ids[] = { -1, 5, 4, 1, 32024, 32013 };
int compress_filter_ids[] = { -1, 5, 4, 1, 32024, 32013, 32003 };
unsigned int *cd_values;

unsigned long
Expand Down Expand Up @@ -882,6 +883,9 @@ _set_params(char *key, char *val_in, bench_params *params_in_out, int do_write)
else if (strcmp(val_in, "ZFP") == 0) {
(*params_in_out).compress_filter = ZFP;
}
else if (strcmp(val_in, "SNAPPY-CUDA") == 0) {
(*params_in_out).compress_filter = SNAPPY-CUDA;
}

else
(*params_in_out).compress_filter = COMPRESS_FILTER_INVALID;
Expand Down
4 changes: 2 additions & 2 deletions commons/h5bench_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ typedef enum compress_filter { // new
N_BIT,
SZIP,
GZIP,
SZ,
SZ3,
ZFP
ZFP,
SNAPPY-CUDA
} compress_filter;

typedef struct bench_params {
Expand Down
7 changes: 4 additions & 3 deletions h5bench_patterns/h5bench_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@

#define DIM_MAX 3
#define H5Z_FILTER_ZFP 32013
#define H5Z_FILTER_SZ 32017
#define H5Z_FILTER_SZ3 32024

#define ABS 0
#define H5Z_FILTER_SNAPPY-CUDA 32003

herr_t ierr;

Expand Down Expand Up @@ -945,6 +943,9 @@ set_globals(const bench_params *params)
else if (params->compress_filter == ZFP) {
ret = H5Pset_filter(COMPRESS_INFO.dcpl_id, H5Z_FILTER_ZFP, H5Z_FLAG_MANDATORY, params->cd_nelmts, cd_values);
}
else if (params->compress_filter == SNAPPY-CUDA) {
ret = H5Pset_filter(COMPRESS_INFO.dcpl_id, H5Z_FILTER_SNAPPY-CUDA, H5Z_FLAG_MANDATORY, params->cd_nelmts, cd_values);
}
else {
ret = -1;
}
Expand Down

0 comments on commit b09c584

Please sign in to comment.