Skip to content

Commit

Permalink
rollback: check ZFP version number is greater than 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorweiss committed Sep 16, 2024
1 parent 505a152 commit b61b208
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
22 changes: 1 addition & 21 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,11 @@ if(ZFP_FOUND)
set(ADIOS2_HAVE_ZFP_CUDA ${ZFP_WITH_CUDA})

# Older versions of ZFP
if(NOT ADIOS2_HAVE_ZFP_CUDA OR NOT ADIOS2_HAVE_ZFP_4D)
if(NOT ADIOS2_HAVE_ZFP_CUDA)
get_target_property(ZFP_INCLUDE_DIRECTORIES zfp::zfp INTERFACE_INCLUDE_DIRECTORIES)
set(CMAKE_REQUIRED_INCLUDES ${ZFP_INCLUDE_DIRECTORIES})
set(CMAKE_REQUIRED_LIBRARIES zfp::zfp)
include(CheckCSourceRuns)

check_c_source_runs("
#include <zfp.h>
Expand All @@ -138,32 +137,13 @@ if(ZFP_FOUND)
return !zfp_stream_set_execution(stream, zfp_exec_cuda);
}"
ADIOS2_HAVE_ZFP_CUDA)

check_c_source_runs("
#include <zfp.h>
int main()
{
float *data = calloc(1024, sizeof(float));
zfp_field *field = zfp_field_4d((char *)(data), zfp_type_float,
4, 4, 4, 4);
zfp_field_free(field);
free(data);
return 0;
}"
ADIOS2_HAVE_ZFP_4D)

unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
endif()

if(ADIOS2_HAVE_ZFP_CUDA)
add_compile_definitions(ADIOS2_HAVE_ZFP_CUDA)
endif()

if(ADIOS2_HAVE_ZFP_4D)
add_compile_definitions(ADIOS2_HAVE_ZFP_4D)
endif()
endif()

# SZ
Expand Down
9 changes: 9 additions & 0 deletions source/adios2/operator/compress/CompressZFP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
#define ZFP_DEFAULT_EXECUTION_POLICY zfp_exec_serial
#endif

/* CMake will make sure zfp >= 0.5.3
ZFP features 4D input data since version 0.5.4
https://zfp.readthedocs.io/en/release0.5.4/versions.html */
#if ZFP_VERSION_MAJOR > 0 \
|| ZFP_VERSION_MINOR > 5 \
|| (ZFP_VERSION_MINOR == 5 && ZFP_VERSION_PATCH > 3)
#define ADIOS2_HAVE_ZFP_4D
#endif

namespace adios2
{
namespace core
Expand Down

0 comments on commit b61b208

Please sign in to comment.