Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(WIN32)
set(ARMADILLO_LIBRARY_DIRS "C:/linalg/bin")

elseif(UNIX)
set(HDF5_ROOT /usr/local/ /usr) # there maybe more upto date library in these places
#set(HDF5_ROOT /usr/local/ /usr) # there maybe more upto date library in these places
include(GNUInstallDirs)
find_package(PkgConfig REQUIRED QUIET)
endif()
Expand All @@ -36,8 +36,9 @@ if(ANDROID)
endif()

include(FindHDF5)
#find_package(HDF5 REQUIRED)
if(HDF5_VERSION VERSION_LESS ${H5CPP_VERSION})
message(FATAL_ERROR "-- !!! H5CPP examples require of HDF5 v${H5CPP_VERSION} or greater!!!")
message(FATAL_ERROR "-- !!! H5CPP examples require of HDF5 v${H5CPP_VERSION} or greater!!! Found version ${HDF5_VERSION}")
else()
message("-- H5CPP ${PROJECT_VERSION} matches with minimum required HDF5 v${HDF5_VERSION}")
endif()
Expand Down
21 changes: 17 additions & 4 deletions h5cpp/H5Zpipeline_basic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,35 @@ inline void h5::impl::basic_pipeline_t::read_chunk_impl( const hsize_t* offset,
size_t length = nbytes; // filter may changed this, think of compression
void *in = chunk0, *out=chunk1, *tmp = chunk1; // invariant: out must point to data block written
uint32_t filter_mask;
[[ maybe-unused ]] size_t chunk_length = block_size;
// for(int i=0; i<9; i++)
// std::cout << ((short*) in)[i] << " ";
// std::cout<<"\n";

switch( tail ){ // tail = index pointing to queue holding filters
case 0: // no filters, ( if blocking ) -> data == chunk0 otherwise directly from container
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0);
case 0: // no filters, ( if blocking ) -> data == chunk0 otherwise directly from container
#ifdef H5Dread_chunk
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0, &chunk_length);
#else
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0);
#enfdif
break;
case 1: // single filter
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk1);
#ifdef H5Dread_chunk
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk1, &chunk_length);
#else
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk1);
#endif
length = filter[0](chunk0, chunk1, nbytes, flags[0], cd_size[0], cd_values[0] );
break;
default: // more than one filter
throw std::runtime_error("filters not implemented yet...");
if( tail % 2 ){
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0);
#ifdef H5Dread_chunk
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0, &chunk_length);
#else
H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0);
#endif
for(int j=tail; j>0; j--){ // invariant: out == buffer holding final result
tmp = in, in = out, out = tmp;
length = filter[j](out,in,length, flags[j], cd_size[j], cd_values[j]);
Expand Down