diff options
Diffstat (limited to 'src/H5VMprivate.h')
-rw-r--r-- | src/H5VMprivate.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 20821b2..8ddb5ee 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -89,8 +89,10 @@ H5_DLL hsize_t H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset); H5_DLL herr_t H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords); -H5_DLL herr_t H5VM_chunk_index(unsigned ndims, const hsize_t *coord, - const uint32_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx); +H5_DLL hsize_t H5VM_chunk_index(unsigned ndims, const hsize_t *coord, + const uint32_t *chunk, const hsize_t *down_nchunks); +H5_DLL hsize_t H5VM_chunk_index_scaled(unsigned ndims, const hsize_t *coord, + const uint32_t *chunk, const hsize_t *down_nchunks, hsize_t *scaled); H5_DLL ssize_t H5VM_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[], size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], @@ -410,6 +412,29 @@ H5VM_log2_of2(uint32_t n) /*------------------------------------------------------------------------- + * Function: H5VM_power2up + * + * Purpose: Round up a number to the next power of 2 + * + * Return: Return the number which is a power of 2 + * + * Programmer: Vailin Choi; Nov 2014 + * + *------------------------------------------------------------------------- + */ +static H5_inline hsize_t UNUSED +H5VM_power2up(hsize_t n) +{ + hsize_t ret_value = 1; /* Return value */ + + while(ret_value < n) + ret_value <<= 1; + + return(ret_value); +} /* H5VM_power2up */ + + +/*------------------------------------------------------------------------- * Function: H5VM_limit_enc_size * * Purpose: Determine the # of bytes needed to encode values within a |