├── .github ├── dependabot.yml └── workflows │ ├── coverage.yml │ ├── debug-linux.yml │ ├── debug-macos.yml │ └── tests.yml ├── .gitignore ├── .readthedocs.yaml ├── CHANGELOG.md ├── CITATION.cff ├── CMakeLists.txt ├── CONTRIBUTING.md ├── CTestConfig.cmake ├── Config ├── LICENSE ├── MANIFEST.in ├── Makefile ├── NOTICE ├── README.md ├── SUPPORT.md ├── appveyor.sh ├── appveyor.yml ├── cfp ├── CMakeLists.txt ├── Makefile ├── cfp.cpp ├── cfparray1d.cpp ├── cfparray1f.cpp ├── cfparray2d.cpp ├── cfparray2f.cpp ├── cfparray3d.cpp ├── cfparray3f.cpp ├── cfparray4d.cpp ├── cfparray4f.cpp ├── cfpheader.cpp └── template │ ├── cfparray.cpp │ ├── cfparray1.cpp │ ├── cfparray2.cpp │ ├── cfparray3.cpp │ ├── cfparray4.cpp │ └── cfpheader.cpp ├── cmake └── appveyor.cmake ├── codecov.yml ├── docs ├── Makefile ├── make.bat ├── requirements.txt └── source │ ├── algorithm.rst │ ├── arrays.rst │ ├── bit-stream.rst │ ├── caching.inc │ ├── cfp.rst │ ├── codec.inc │ ├── conf.py │ ├── contributors.rst │ ├── defs.rst │ ├── directions.rst │ ├── disclaimer.inc │ ├── examples.rst │ ├── execution.rst │ ├── faq.rst │ ├── high-level-api.rst │ ├── index.inc │ ├── index.rst │ ├── installation.rst │ ├── introduction.rst │ ├── issues.rst │ ├── iterators.inc │ ├── license.rst │ ├── limitations.rst │ ├── low-level-api.rst │ ├── modes.rst │ ├── pointers.inc │ ├── python.rst │ ├── references.inc │ ├── requirements.txt │ ├── serialization.inc │ ├── setup.py │ ├── testing.rst │ ├── tutorial.rst │ ├── versions.rst │ ├── view-indexing.pdf │ ├── views.inc │ ├── zforp.rst │ ├── zfp-rounding.pdf │ └── zfpcmd.rst ├── examples ├── CMakeLists.txt ├── Makefile ├── array.cpp ├── array2d.hpp ├── chunk.c ├── diffusion.cpp ├── diffusionC.c ├── inplace.c ├── iterator.cpp ├── iteratorC.c ├── pgm.c ├── ppm.c ├── simple.c └── speed.c ├── fortran ├── CMakeLists.txt ├── Makefile └── zfp.f90 ├── include ├── zfp.h ├── zfp.hpp └── zfp │ ├── array.h │ ├── array.hpp │ ├── array1.hpp │ ├── array2.hpp │ ├── array3.hpp │ ├── array4.hpp │ ├── bitstream.h │ ├── bitstream.inl │ ├── codec │ ├── gencodec.hpp │ └── zfpcodec.hpp │ ├── constarray1.hpp │ ├── constarray2.hpp │ ├── constarray3.hpp │ ├── constarray4.hpp │ ├── factory.hpp │ ├── index.hpp │ ├── internal │ ├── array │ │ ├── cache.hpp │ │ ├── cache1.hpp │ │ ├── cache2.hpp │ │ ├── cache3.hpp │ │ ├── cache4.hpp │ │ ├── exception.hpp │ │ ├── handle1.hpp │ │ ├── handle2.hpp │ │ ├── handle3.hpp │ │ ├── handle4.hpp │ │ ├── header.hpp │ │ ├── iterator1.hpp │ │ ├── iterator2.hpp │ │ ├── iterator3.hpp │ │ ├── iterator4.hpp │ │ ├── memory.hpp │ │ ├── pointer1.hpp │ │ ├── pointer2.hpp │ │ ├── pointer3.hpp │ │ ├── pointer4.hpp │ │ ├── reference1.hpp │ │ ├── reference2.hpp │ │ ├── reference3.hpp │ │ ├── reference4.hpp │ │ ├── store.hpp │ │ ├── store1.hpp │ │ ├── store2.hpp │ │ ├── store3.hpp │ │ ├── store4.hpp │ │ ├── traits.hpp │ │ ├── view1.hpp │ │ ├── view2.hpp │ │ ├── view3.hpp │ │ └── view4.hpp │ ├── cfp │ │ ├── array1d.h │ │ ├── array1f.h │ │ ├── array2d.h │ │ ├── array2f.h │ │ ├── array3d.h │ │ ├── array3f.h │ │ ├── array4d.h │ │ ├── array4f.h │ │ └── header.h │ ├── codec │ │ ├── genheader.hpp │ │ └── zfpheader.hpp │ └── zfp │ │ ├── inline.h │ │ ├── macros.h │ │ ├── system.h │ │ └── types.h │ └── version.h ├── pyproject.toml ├── python ├── CMakeLists.txt ├── requirements.txt ├── scikit-build-cmake │ ├── FindCython.cmake │ ├── FindNumPy.cmake │ ├── FindPythonExtensions.cmake │ ├── LICENSE │ ├── UseCython.cmake │ ├── UsePythonExtensions.cmake │ └── targetLinkLibrariesWithDynamicLookup.cmake ├── zfpy.pxd └── zfpy.pyx ├── setup.py ├── src ├── CMakeLists.txt ├── Makefile ├── bitstream.c ├── block1.h ├── block2.h ├── block3.h ├── block4.h ├── cuda_zfp │ ├── CMakeLists.txt │ ├── ErrorCheck.h │ ├── constants.h │ ├── cuZFP.cu │ ├── cuZFP.h │ ├── decode.cuh │ ├── decode1.cuh │ ├── decode2.cuh │ ├── decode3.cuh │ ├── encode.cuh │ ├── encode1.cuh │ ├── encode2.cuh │ ├── encode3.cuh │ ├── pointers.cuh │ ├── shared.h │ └── type_info.cuh ├── decode1d.c ├── decode1f.c ├── decode1i.c ├── decode1l.c ├── decode2d.c ├── decode2f.c ├── decode2i.c ├── decode2l.c ├── decode3d.c ├── decode3f.c ├── decode3i.c ├── decode3l.c ├── decode4d.c ├── decode4f.c ├── decode4i.c ├── decode4l.c ├── encode1d.c ├── encode1f.c ├── encode1i.c ├── encode1l.c ├── encode2d.c ├── encode2f.c ├── encode2i.c ├── encode2l.c ├── encode3d.c ├── encode3f.c ├── encode3i.c ├── encode3l.c ├── encode4d.c ├── encode4f.c ├── encode4i.c ├── encode4l.c ├── share │ ├── omp.c │ └── parallel.c ├── template │ ├── codec.c │ ├── codec.h │ ├── codec1.c │ ├── codec2.c │ ├── codec3.c │ ├── codec4.c │ ├── codecf.c │ ├── compress.c │ ├── cudacompress.c │ ├── cudadecompress.c │ ├── decode.c │ ├── decode1.c │ ├── decode2.c │ ├── decode3.c │ ├── decode4.c │ ├── decodef.c │ ├── decodei.c │ ├── decompress.c │ ├── encode.c │ ├── encode1.c │ ├── encode2.c │ ├── encode3.c │ ├── encode4.c │ ├── encodef.c │ ├── encodei.c │ ├── ompcompress.c │ ├── revcodecf.c │ ├── revdecode.c │ ├── revdecode1.c │ ├── revdecode2.c │ ├── revdecode3.c │ ├── revdecode4.c │ ├── revdecodef.c │ ├── revencode.c │ ├── revencode1.c │ ├── revencode2.c │ ├── revencode3.c │ ├── revencode4.c │ ├── revencodef.c │ └── template.h ├── traitsd.h ├── traitsf.h ├── traitsi.h ├── traitsl.h └── zfp.c ├── tests ├── CMakeLists.txt ├── CMakeLists.txt.in ├── Makefile ├── array │ ├── CMakeLists.txt │ ├── array │ │ ├── CMakeLists.txt │ │ ├── testArray1Base.cpp │ │ ├── testArray1ItersBase.cpp │ │ ├── testArray1RefsBase.cpp │ │ ├── testArray1ViewsBase.cpp │ │ ├── testArray1d.cpp │ │ ├── testArray1dIters.cpp │ │ ├── testArray1dPtrs.cpp │ │ ├── testArray1dRefs.cpp │ │ ├── testArray1dViewIters.cpp │ │ ├── testArray1dViewPtrs.cpp │ │ ├── testArray1dViews.cpp │ │ ├── testArray1f.cpp │ │ ├── testArray1fIters.cpp │ │ ├── testArray1fPtrs.cpp │ │ ├── testArray1fRefs.cpp │ │ ├── testArray1fViewIters.cpp │ │ ├── testArray1fViewPtrs.cpp │ │ ├── testArray1fViews.cpp │ │ ├── testArray2Base.cpp │ │ ├── testArray2ItersBase.cpp │ │ ├── testArray2PtrsBase.cpp │ │ ├── testArray2RefsBase.cpp │ │ ├── testArray2ViewsBase.cpp │ │ ├── testArray2d.cpp │ │ ├── testArray2dIters.cpp │ │ ├── testArray2dPtrs.cpp │ │ ├── testArray2dRefs.cpp │ │ ├── testArray2dViewIters.cpp │ │ ├── testArray2dViewPtrs.cpp │ │ ├── testArray2dViews.cpp │ │ ├── testArray2f.cpp │ │ ├── testArray2fIters.cpp │ │ ├── testArray2fPtrs.cpp │ │ ├── testArray2fRefs.cpp │ │ ├── testArray2fViewIters.cpp │ │ ├── testArray2fViewPtrs.cpp │ │ ├── testArray2fViews.cpp │ │ ├── testArray3Base.cpp │ │ ├── testArray3ItersBase.cpp │ │ ├── testArray3PtrsBase.cpp │ │ ├── testArray3RefsBase.cpp │ │ ├── testArray3ViewsBase.cpp │ │ ├── testArray3d.cpp │ │ ├── testArray3dIters.cpp │ │ ├── testArray3dPtrs.cpp │ │ ├── testArray3dRefs.cpp │ │ ├── testArray3dViewIters.cpp │ │ ├── testArray3dViewPtrs.cpp │ │ ├── testArray3dViews.cpp │ │ ├── testArray3f.cpp │ │ ├── testArray3fIters.cpp │ │ ├── testArray3fPtrs.cpp │ │ ├── testArray3fRefs.cpp │ │ ├── testArray3fViewIters.cpp │ │ ├── testArray3fViewPtrs.cpp │ │ ├── testArray3fViews.cpp │ │ ├── testArray4Base.cpp │ │ ├── testArray4ItersBase.cpp │ │ ├── testArray4PtrsBase.cpp │ │ ├── testArray4RefsBase.cpp │ │ ├── testArray4ViewsBase.cpp │ │ ├── testArray4d.cpp │ │ ├── testArray4dIters.cpp │ │ ├── testArray4dPtrs.cpp │ │ ├── testArray4dRefs.cpp │ │ ├── testArray4dViewIters.cpp │ │ ├── testArray4dViewPtrs.cpp │ │ ├── testArray4dViews.cpp │ │ ├── testArray4f.cpp │ │ ├── testArray4fIters.cpp │ │ ├── testArray4fPtrs.cpp │ │ ├── testArray4fRefs.cpp │ │ ├── testArray4fViewIters.cpp │ │ ├── testArray4fViewPtrs.cpp │ │ ├── testArray4fViews.cpp │ │ ├── testArrayBase.cpp │ │ ├── testArrayItersBase.cpp │ │ ├── testArrayPtrsBase.cpp │ │ ├── testArrayRefsBase.cpp │ │ ├── testArrayViewItersBase.cpp │ │ ├── testArrayViewPtrsBase.cpp │ │ ├── testArrayViewsBase.cpp │ │ └── testConstruct.cpp │ ├── constArray │ │ ├── CMakeLists.txt │ │ ├── testConstArray1Base.cpp │ │ ├── testConstArray1d.cpp │ │ ├── testConstArray1f.cpp │ │ ├── testConstArray2Base.cpp │ │ ├── testConstArray2d.cpp │ │ ├── testConstArray2f.cpp │ │ ├── testConstArray3Base.cpp │ │ ├── testConstArray3d.cpp │ │ ├── testConstArray3f.cpp │ │ ├── testConstArray4Base.cpp │ │ ├── testConstArray4d.cpp │ │ ├── testConstArray4f.cpp │ │ └── testConstArrayBase.cpp │ ├── decode │ │ ├── CMakeLists.txt │ │ ├── testTemplatedDecode1d.cpp │ │ ├── testTemplatedDecode1f.cpp │ │ ├── testTemplatedDecode2d.cpp │ │ ├── testTemplatedDecode2f.cpp │ │ ├── testTemplatedDecode3d.cpp │ │ ├── testTemplatedDecode3f.cpp │ │ ├── testTemplatedDecode4d.cpp │ │ ├── testTemplatedDecode4f.cpp │ │ └── testTemplatedDecodeBase.cpp │ ├── encode │ │ ├── CMakeLists.txt │ │ ├── testTemplatedEncode1d.cpp │ │ ├── testTemplatedEncode1f.cpp │ │ ├── testTemplatedEncode2d.cpp │ │ ├── testTemplatedEncode2f.cpp │ │ ├── testTemplatedEncode3d.cpp │ │ ├── testTemplatedEncode3f.cpp │ │ ├── testTemplatedEncode4d.cpp │ │ ├── testTemplatedEncode4f.cpp │ │ └── testTemplatedEncodeBase.cpp │ ├── utils │ │ ├── commonMacros.h │ │ ├── gtest1dTest.h │ │ ├── gtest1fTest.h │ │ ├── gtest2dTest.h │ │ ├── gtest2fTest.h │ │ ├── gtest3dTest.h │ │ ├── gtest3fTest.h │ │ ├── gtest4dTest.h │ │ ├── gtest4fTest.h │ │ ├── gtestBaseFixture.h │ │ ├── gtestCApiTest.h │ │ ├── gtestDoubleEnv.h │ │ ├── gtestFloatEnv.h │ │ ├── gtestSingleFixture.h │ │ ├── gtestTestEnv.h │ │ └── predicates.h │ └── zfp │ │ ├── CMakeLists.txt │ │ └── testAlignedMemory.cpp ├── cfp │ ├── CMakeLists.txt │ ├── testCfpArray1_source.c │ ├── testCfpArray1d.c │ ├── testCfpArray1f.c │ ├── testCfpArray2_source.c │ ├── testCfpArray2d.c │ ├── testCfpArray2f.c │ ├── testCfpArray3_source.c │ ├── testCfpArray3d.c │ ├── testCfpArray3f.c │ ├── testCfpArray4_source.c │ ├── testCfpArray4d.c │ ├── testCfpArray4f.c │ ├── testCfpArray_source.c │ └── testCfpNamespace.c ├── ci-utils │ └── CMakeLists.txt ├── constants │ ├── 1dDouble.h │ ├── 1dFloat.h │ ├── 1dInt32.h │ ├── 1dInt64.h │ ├── 2dDouble.h │ ├── 2dFloat.h │ ├── 2dInt32.h │ ├── 2dInt64.h │ ├── 3dDouble.h │ ├── 3dFloat.h │ ├── 3dInt32.h │ ├── 3dInt64.h │ ├── 4dDouble.h │ ├── 4dFloat.h │ ├── 4dInt32.h │ ├── 4dInt64.h │ ├── checksums │ │ ├── 1dDouble.h │ │ ├── 1dFloat.h │ │ ├── 1dInt32.h │ │ ├── 1dInt64.h │ │ ├── 2dDouble.h │ │ ├── 2dFloat.h │ │ ├── 2dInt32.h │ │ ├── 2dInt64.h │ │ ├── 3dDouble.h │ │ ├── 3dFloat.h │ │ ├── 3dInt32.h │ │ ├── 3dInt64.h │ │ ├── 4dDouble.h │ │ ├── 4dFloat.h │ │ ├── 4dInt32.h │ │ └── 4dInt64.h │ ├── doubleConsts.h │ ├── floatConsts.h │ ├── int32Consts.h │ ├── int64Consts.h │ └── universalConsts.h ├── fortran │ ├── CMakeLists.txt │ └── testFortran.f ├── gitlab │ ├── corona-jobs.yml │ ├── corona-templates.yml │ ├── dane-jobs.yml │ ├── dane-templates.yml │ ├── gitlab-ci.yml │ ├── lassen-jobs.yml │ ├── lassen-templates.yml │ ├── pascal-jobs.yml │ ├── pascal-templates.yml │ ├── quartz-jobs.yml │ └── quartz-templates.yml ├── python │ ├── CMakeLists.txt │ ├── test_numpy.py │ └── test_utils.pyx ├── src │ ├── CMakeLists.txt │ ├── decode │ │ ├── CMakeLists.txt │ │ ├── testZfpDecodeBlock1dDouble.c │ │ ├── testZfpDecodeBlock1dFloat.c │ │ ├── testZfpDecodeBlock1dInt32.c │ │ ├── testZfpDecodeBlock1dInt64.c │ │ ├── testZfpDecodeBlock2dDouble.c │ │ ├── testZfpDecodeBlock2dFloat.c │ │ ├── testZfpDecodeBlock2dInt32.c │ │ ├── testZfpDecodeBlock2dInt64.c │ │ ├── testZfpDecodeBlock3dDouble.c │ │ ├── testZfpDecodeBlock3dFloat.c │ │ ├── testZfpDecodeBlock3dInt32.c │ │ ├── testZfpDecodeBlock3dInt64.c │ │ ├── testZfpDecodeBlock4dDouble.c │ │ ├── testZfpDecodeBlock4dFloat.c │ │ ├── testZfpDecodeBlock4dInt32.c │ │ ├── testZfpDecodeBlock4dInt64.c │ │ ├── testZfpDecodeBlockStrided1dDouble.c │ │ ├── testZfpDecodeBlockStrided1dFloat.c │ │ ├── testZfpDecodeBlockStrided1dInt32.c │ │ ├── testZfpDecodeBlockStrided1dInt64.c │ │ ├── testZfpDecodeBlockStrided2dDouble.c │ │ ├── testZfpDecodeBlockStrided2dFloat.c │ │ ├── testZfpDecodeBlockStrided2dInt32.c │ │ ├── testZfpDecodeBlockStrided2dInt64.c │ │ ├── testZfpDecodeBlockStrided3dDouble.c │ │ ├── testZfpDecodeBlockStrided3dFloat.c │ │ ├── testZfpDecodeBlockStrided3dInt32.c │ │ ├── testZfpDecodeBlockStrided3dInt64.c │ │ ├── testZfpDecodeBlockStrided4dDouble.c │ │ ├── testZfpDecodeBlockStrided4dFloat.c │ │ ├── testZfpDecodeBlockStrided4dInt32.c │ │ ├── testZfpDecodeBlockStrided4dInt64.c │ │ ├── testcases │ │ │ ├── block.c │ │ │ └── blockStrided.c │ │ ├── zfpDecodeBlockBase.c │ │ └── zfpDecodeBlockStridedBase.c │ ├── encode │ │ ├── CMakeLists.txt │ │ ├── testZfpEncodeBlock1dDouble.c │ │ ├── testZfpEncodeBlock1dFloat.c │ │ ├── testZfpEncodeBlock1dInt32.c │ │ ├── testZfpEncodeBlock1dInt64.c │ │ ├── testZfpEncodeBlock2dDouble.c │ │ ├── testZfpEncodeBlock2dFloat.c │ │ ├── testZfpEncodeBlock2dInt32.c │ │ ├── testZfpEncodeBlock2dInt64.c │ │ ├── testZfpEncodeBlock3dDouble.c │ │ ├── testZfpEncodeBlock3dFloat.c │ │ ├── testZfpEncodeBlock3dInt32.c │ │ ├── testZfpEncodeBlock3dInt64.c │ │ ├── testZfpEncodeBlock4dDouble.c │ │ ├── testZfpEncodeBlock4dFloat.c │ │ ├── testZfpEncodeBlock4dInt32.c │ │ ├── testZfpEncodeBlock4dInt64.c │ │ ├── testZfpEncodeBlockStrided1dDouble.c │ │ ├── testZfpEncodeBlockStrided1dFloat.c │ │ ├── testZfpEncodeBlockStrided1dInt32.c │ │ ├── testZfpEncodeBlockStrided1dInt64.c │ │ ├── testZfpEncodeBlockStrided2dDouble.c │ │ ├── testZfpEncodeBlockStrided2dFloat.c │ │ ├── testZfpEncodeBlockStrided2dInt32.c │ │ ├── testZfpEncodeBlockStrided2dInt64.c │ │ ├── testZfpEncodeBlockStrided3dDouble.c │ │ ├── testZfpEncodeBlockStrided3dFloat.c │ │ ├── testZfpEncodeBlockStrided3dInt32.c │ │ ├── testZfpEncodeBlockStrided3dInt64.c │ │ ├── testZfpEncodeBlockStrided4dDouble.c │ │ ├── testZfpEncodeBlockStrided4dFloat.c │ │ ├── testZfpEncodeBlockStrided4dInt32.c │ │ ├── testZfpEncodeBlockStrided4dInt64.c │ │ ├── testcases │ │ │ ├── block.c │ │ │ └── blockStrided.c │ │ ├── zfpEncodeBlockBase.c │ │ └── zfpEncodeBlockStridedBase.c │ ├── endtoend │ │ ├── CMakeLists.txt │ │ ├── cudaExecBase.c │ │ ├── ompExecBase.c │ │ ├── serialExecBase.c │ │ ├── testZfpCuda1dDouble.c │ │ ├── testZfpCuda1dFloat.c │ │ ├── testZfpCuda1dInt32.c │ │ ├── testZfpCuda1dInt64.c │ │ ├── testZfpCuda2dDouble.c │ │ ├── testZfpCuda2dFloat.c │ │ ├── testZfpCuda2dInt32.c │ │ ├── testZfpCuda2dInt64.c │ │ ├── testZfpCuda3dDouble.c │ │ ├── testZfpCuda3dFloat.c │ │ ├── testZfpCuda3dInt32.c │ │ ├── testZfpCuda3dInt64.c │ │ ├── testZfpCuda4dDouble.c │ │ ├── testZfpCuda4dFloat.c │ │ ├── testZfpCuda4dInt32.c │ │ ├── testZfpCuda4dInt64.c │ │ ├── testZfpOmp1dDouble.c │ │ ├── testZfpOmp1dFloat.c │ │ ├── testZfpOmp1dInt32.c │ │ ├── testZfpOmp1dInt64.c │ │ ├── testZfpOmp2dDouble.c │ │ ├── testZfpOmp2dFloat.c │ │ ├── testZfpOmp2dInt32.c │ │ ├── testZfpOmp2dInt64.c │ │ ├── testZfpOmp3dDouble.c │ │ ├── testZfpOmp3dFloat.c │ │ ├── testZfpOmp3dInt32.c │ │ ├── testZfpOmp3dInt64.c │ │ ├── testZfpOmp4dDouble.c │ │ ├── testZfpOmp4dFloat.c │ │ ├── testZfpOmp4dInt32.c │ │ ├── testZfpOmp4dInt64.c │ │ ├── testZfpSerial1dDouble.c │ │ ├── testZfpSerial1dFloat.c │ │ ├── testZfpSerial1dInt32.c │ │ ├── testZfpSerial1dInt64.c │ │ ├── testZfpSerial2dDouble.c │ │ ├── testZfpSerial2dFloat.c │ │ ├── testZfpSerial2dInt32.c │ │ ├── testZfpSerial2dInt64.c │ │ ├── testZfpSerial3dDouble.c │ │ ├── testZfpSerial3dFloat.c │ │ ├── testZfpSerial3dInt32.c │ │ ├── testZfpSerial3dInt64.c │ │ ├── testZfpSerial4dDouble.c │ │ ├── testZfpSerial4dFloat.c │ │ ├── testZfpSerial4dInt32.c │ │ ├── testZfpSerial4dInt64.c │ │ ├── testcases │ │ │ ├── cuda.c │ │ │ ├── omp.c │ │ │ └── serial.c │ │ └── zfpEndtoendBase.c │ ├── execPolicy │ │ ├── CMakeLists.txt │ │ ├── testCuda.c │ │ ├── testOmp.c │ │ └── testOmpInternal.c │ ├── inline │ │ ├── CMakeLists.txt │ │ ├── testBitstream.c │ │ ├── testBitstreamSmallWsize.c │ │ └── testBitstreamStrided.c │ └── misc │ │ ├── CMakeLists.txt │ │ ├── testZfpField1d.c │ │ ├── testZfpField1f.c │ │ ├── testZfpField2d.c │ │ ├── testZfpField2f.c │ │ ├── testZfpField3d.c │ │ ├── testZfpField3f.c │ │ ├── testZfpField4d.c │ │ ├── testZfpField4f.c │ │ ├── testZfpHeader.c │ │ ├── testZfpPromote.c │ │ ├── testZfpStream.c │ │ └── zfpFieldBase.c ├── testviews.cpp ├── testzfp.cpp └── utils │ ├── CMakeLists.txt │ ├── fixedpoint96.c │ ├── fixedpoint96.h │ ├── genChecksums.sh │ ├── genSmoothRandNums.c │ ├── genSmoothRandNums.h │ ├── rand32.c │ ├── rand32.h │ ├── rand64.c │ ├── rand64.h │ ├── stridedOperations.c │ ├── stridedOperations.h │ ├── testMacros.h │ ├── zfpChecksums.c │ ├── zfpChecksums.h │ ├── zfpCompressionParams.c │ ├── zfpCompressionParams.h │ ├── zfpHash.c │ ├── zfpHash.h │ ├── zfpTimer.c │ └── zfpTimer.h ├── utils ├── CMakeLists.txt ├── Makefile └── zfp.c ├── zfp-config-version.cmake.in └── zfp-config.cmake.in /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "weekly" 8 | -------------------------------------------------------------------------------- /.github/workflows/debug-linux.yml: -------------------------------------------------------------------------------- 1 | name: Debug (Linux) 2 | 3 | on: [workflow_dispatch] 4 | 5 | jobs: 6 | debug: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout Zfp 10 | uses: actions/checkout@v4 11 | 12 | - name: Setup Python 13 | uses: actions/setup-python@v5 14 | with: 15 | python-version: '3.x' 16 | architecture: x64 17 | 18 | - name: Install Zfpy Dependencies 19 | run: | 20 | python -m pip install cython 21 | python -m pip install oldest-supported-numpy 22 | python -m pip install setuptools 23 | 24 | - name: Install OpenMP 25 | run: | 26 | sudo apt-get update; sudo apt-get install -y libomp5 libomp-dev 27 | 28 | - name: Setup Tmate Session 29 | uses: mxschmitt/action-tmate@v3 30 | -------------------------------------------------------------------------------- /.github/workflows/debug-macos.yml: -------------------------------------------------------------------------------- 1 | name: Debug (MacOS) 2 | 3 | on: [workflow_dispatch] 4 | 5 | jobs: 6 | debug: 7 | runs-on: macos-latest 8 | steps: 9 | - name: Checkout Zfp 10 | uses: actions/checkout@v4 11 | 12 | - name: Setup Python 13 | uses: actions/setup-python@v5 14 | with: 15 | python-version: '3.x' 16 | architecture: x64 17 | 18 | - name: Install Zfpy Dependencies 19 | run: | 20 | python -m pip install cython 21 | python -m pip install oldest-supported-numpy 22 | python -m pip install setuptools 23 | 24 | - name: Install OpenMP 25 | run: | 26 | brew install libomp 27 | 28 | - name: Setup Tmate Session 29 | uses: mxschmitt/action-tmate@v3 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | bin 4 | build 5 | lib 6 | dist 7 | wheelhouse 8 | zfpy.egg-info 9 | modules 10 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.12" 12 | # You can also specify other tool versions: 13 | # nodejs: "20" 14 | # rust: "1.70" 15 | # golang: "1.20" 16 | 17 | # Build documentation in the "docs/" directory with Sphinx 18 | sphinx: 19 | configuration: docs/source/conf.py 20 | # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs 21 | # builder: "dirhtml" 22 | # Fail on all warnings to avoid broken references 23 | # fail_on_warning: true 24 | 25 | # Optionally build your docs in additional formats such as PDF and ePub 26 | formats: 27 | - pdf 28 | # - epub 29 | 30 | # Optional but recommended, declare the Python requirements required 31 | # to build your documentation 32 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 33 | python: 34 | install: 35 | - requirements: docs/requirements.txt 36 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.1.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - family-names: Lindstrom 5 | given-names: Peter 6 | orcid: https://orcid.org/0000-0003-3817-4199 7 | title: "Fixed-Rate Compressed Floating-Point Arrays" 8 | journal: "IEEE Transactions on Visualization and Computer Graphics" 9 | volume: 20 10 | number: 12 11 | start: 2674 12 | end: 2683 13 | year: 2014 14 | month: 12 15 | version: develop 16 | doi: 10.1109/TVCG.2014.2346458 17 | date-released: 2014-11-05 18 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | The zfp project uses the 5 | [Gitflow](https://nvie.com/posts/a-successful-git-branching-model/) 6 | development model. Contributions should be made as pull requests on the 7 | `develop` branch. Although this branch is under continuous development, 8 | it should be robust enough to pass all regression tests. For contributions 9 | that are not production ready, please [contact us](mailto:zfp.llnl.gov) to 10 | have a separate branch created. The `master` branch is updated with each 11 | release and reflects the most recent official release of zfp. See the 12 | [Releases Page](https://github.com/LLNL/zfp/releases) for a history 13 | of releases. 14 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | ## This file should be placed in the root directory of your project. 2 | ## Then modify the CMakeLists.txt file in the root directory of your 3 | ## project to incorporate the testing dashboard. 4 | ## # The following are required to uses Dart and the Cdash dashboard 5 | ## ENABLE_TESTING() 6 | ## INCLUDE(CTest) 7 | set(CTEST_PROJECT_NAME "ZFP") 8 | set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") 9 | 10 | set(CTEST_DROP_METHOD "https") 11 | set(CTEST_DROP_SITE "open.cdash.org") 12 | set(CTEST_DROP_LOCATION "/submit.php?project=zfp") 13 | set(CTEST_DROP_SITE_CDASH TRUE) 14 | 15 | # Test Options 16 | set(MEMORYCHECK_COMMAND_OPTIONS "--show-reachable=no") 17 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include python/zfpy.pxd 2 | include python/zfpy.pyx 3 | recursive-include include *.h 4 | recursive-include src *.c *.h 5 | include LICENSE 6 | include pyproject.toml -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # see Config file for compile-time settings 2 | include Config 3 | 4 | MAKEFLAGS += --no-print-directory 5 | 6 | 7 | # default: build all targets enabled in Config 8 | all: 9 | @echo $(LIBRARY) 10 | @cd src; $(MAKE) clean $(LIBRARY) 11 | ifneq ($(BUILD_CFP),0) 12 | @cd cfp; $(MAKE) clean $(LIBRARY) 13 | endif 14 | ifneq ($(BUILD_ZFORP),0) 15 | @cd fortran; $(MAKE) clean $(LIBRARY) 16 | endif 17 | ifneq ($(BUILD_UTILITIES),0) 18 | @cd utils; $(MAKE) clean all 19 | endif 20 | ifneq ($(BUILD_TESTING),0) 21 | @cd tests; $(MAKE) clean all 22 | endif 23 | ifneq ($(BUILD_EXAMPLES),0) 24 | @cd examples; $(MAKE) clean all 25 | endif 26 | 27 | 28 | # run basic regression tests 29 | test: 30 | @cd tests; $(MAKE) test 31 | 32 | 33 | # clean all 34 | clean: 35 | @cd src; $(MAKE) clean 36 | @cd cfp; $(MAKE) clean 37 | @cd fortran; $(MAKE) clean 38 | @cd utils; $(MAKE) clean 39 | @cd tests; $(MAKE) clean 40 | @cd examples; $(MAKE) clean 41 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | This work was produced under the auspices of the U.S. Department of 2 | Energy by Lawrence Livermore National Laboratory under Contract 3 | DE-AC52-07NA27344. 4 | 5 | This work was prepared as an account of work sponsored by an agency of 6 | the United States Government. Neither the United States Government nor 7 | Lawrence Livermore National Security, LLC, nor any of their employees 8 | makes any warranty, expressed or implied, or assumes any legal liability 9 | or responsibility for the accuracy, completeness, or usefulness of any 10 | information, apparatus, product, or process disclosed, or represents that 11 | its use would not infringe privately owned rights. 12 | 13 | Reference herein to any specific commercial product, process, or service 14 | by trade name, trademark, manufacturer, or otherwise does not necessarily 15 | constitute or imply its endorsement, recommendation, or favoring by the 16 | United States Government or Lawrence Livermore National Security, LLC. 17 | 18 | The views and opinions of authors expressed herein do not necessarily 19 | state or reflect those of the United States Government or Lawrence 20 | Livermore National Security, LLC, and shall not be used for advertising 21 | or product endorsement purposes. 22 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | Support 2 | ======= 3 | 4 | For more information on zfp, please see the 5 | [zfp website](https://zfp.llnl.gov). 6 | For bug reports and feature requests, please consult the 7 | [GitHub issue tracker](https://github.com/LLNL/zfp/issues/). 8 | For questions and comments not answered here or in the 9 | [documentation](http://zfp.readthedocs.io), 10 | please contact us by email at 11 | [zfp@llnl.gov](mailto:zfp@llnl.gov). 12 | -------------------------------------------------------------------------------- /cfp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(cfp cfp.cpp) 2 | 3 | if(DEFINED CFP_NAMESPACE) 4 | list(APPEND cfp_public_defs "CFP_NAMESPACE=${CFP_NAMESPACE}") 5 | endif() 6 | 7 | list(APPEND cfp_private_defs ${zfp_compressed_array_defs}) 8 | 9 | if(WIN32 AND BUILD_SHARED_LIBS) 10 | # define ZFP_SOURCE when compiling libcfp to export symbols to Windows DLL 11 | list(APPEND cfp_public_defs ZFP_SHARED_LIBS) 12 | list(APPEND cfp_private_defs ZFP_SOURCE) 13 | endif() 14 | 15 | target_compile_definitions(cfp 16 | PUBLIC ${cfp_public_defs} 17 | PRIVATE ${cfp_private_defs}) 18 | 19 | target_include_directories(cfp 20 | PUBLIC 21 | $ 22 | $ 23 | PRIVATE 24 | ${ZFP_SOURCE_DIR}/src 25 | ) 26 | 27 | target_link_libraries(cfp zfp) 28 | 29 | set_property(TARGET cfp PROPERTY VERSION ${ZFP_VERSION}) 30 | set_property(TARGET cfp PROPERTY SOVERSION ${ZFP_VERSION_MAJOR}) 31 | set_property(TARGET cfp PROPERTY OUTPUT_NAME ${ZFP_LIBRARY_PREFIX}cfp) 32 | 33 | install(TARGETS cfp EXPORT cfp-targets 34 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 35 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 36 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 37 | -------------------------------------------------------------------------------- /cfp/Makefile: -------------------------------------------------------------------------------- 1 | include ../Config 2 | 3 | LIBDIR = ../lib 4 | TARGETS = $(LIBDIR)/libcfp.a $(LIBDIR)/libcfp.so 5 | OBJECTS = cfp.o 6 | INCS = -I../include -I../src 7 | 8 | static: $(LIBDIR)/libcfp.a 9 | 10 | shared: $(LIBDIR)/libcfp.so 11 | 12 | clean: 13 | rm -f $(TARGETS) $(OBJECTS) 14 | 15 | $(LIBDIR)/libcfp.a: $(OBJECTS) 16 | mkdir -p $(LIBDIR) 17 | rm -f $@ 18 | ar rc $@ $^ 19 | 20 | $(LIBDIR)/libcfp.so: $(OBJECTS) 21 | mkdir -p $(LIBDIR) 22 | $(CXX) $(CXXFLAGS) -shared $(SOFLAGS) $^ -o $@ 23 | 24 | .cpp.o: 25 | $(CXX) $(CXXFLAGS) $(INCS) -c $< 26 | -------------------------------------------------------------------------------- /cfp/cfparray1d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array1d.h" 2 | #include "zfp/array1.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array1d 7 | #define CFP_REF_TYPE cfp_ref1d 8 | #define CFP_PTR_TYPE cfp_ptr1d 9 | #define CFP_ITER_TYPE cfp_iter1d 10 | #define ZFP_ARRAY_TYPE zfp::array1d 11 | #define ZFP_SCALAR_TYPE double 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray1.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfparray1f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array1f.h" 2 | #include "zfp/array1.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array1f 7 | #define CFP_REF_TYPE cfp_ref1f 8 | #define CFP_PTR_TYPE cfp_ptr1f 9 | #define CFP_ITER_TYPE cfp_iter1f 10 | #define ZFP_ARRAY_TYPE zfp::array1f 11 | #define ZFP_SCALAR_TYPE float 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray1.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfparray2d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array2d.h" 2 | #include "zfp/array2.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array2d 7 | #define CFP_REF_TYPE cfp_ref2d 8 | #define CFP_PTR_TYPE cfp_ptr2d 9 | #define CFP_ITER_TYPE cfp_iter2d 10 | #define ZFP_ARRAY_TYPE zfp::array2d 11 | #define ZFP_SCALAR_TYPE double 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray2.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfparray2f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array2f.h" 2 | #include "zfp/array2.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array2f 7 | #define CFP_REF_TYPE cfp_ref2f 8 | #define CFP_PTR_TYPE cfp_ptr2f 9 | #define CFP_ITER_TYPE cfp_iter2f 10 | #define ZFP_ARRAY_TYPE zfp::array2f 11 | #define ZFP_SCALAR_TYPE float 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray2.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfparray3d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array3d.h" 2 | #include "zfp/array3.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array3d 7 | #define CFP_REF_TYPE cfp_ref3d 8 | #define CFP_PTR_TYPE cfp_ptr3d 9 | #define CFP_ITER_TYPE cfp_iter3d 10 | #define ZFP_ARRAY_TYPE zfp::array3d 11 | #define ZFP_SCALAR_TYPE double 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray3.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfparray3f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array3f.h" 2 | #include "zfp/array3.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array3f 7 | #define CFP_REF_TYPE cfp_ref3f 8 | #define CFP_PTR_TYPE cfp_ptr3f 9 | #define CFP_ITER_TYPE cfp_iter3f 10 | #define ZFP_ARRAY_TYPE zfp::array3f 11 | #define ZFP_SCALAR_TYPE float 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray3.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfparray4d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array4d.h" 2 | #include "zfp/array4.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array4d 7 | #define CFP_REF_TYPE cfp_ref4d 8 | #define CFP_PTR_TYPE cfp_ptr4d 9 | #define CFP_ITER_TYPE cfp_iter4d 10 | #define ZFP_ARRAY_TYPE zfp::array4d 11 | #define ZFP_SCALAR_TYPE double 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray4.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfparray4f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/cfp/array4f.h" 2 | #include "zfp/array4.hpp" 3 | 4 | #include "template/template.h" 5 | 6 | #define CFP_ARRAY_TYPE cfp_array4f 7 | #define CFP_REF_TYPE cfp_ref4f 8 | #define CFP_PTR_TYPE cfp_ptr4f 9 | #define CFP_ITER_TYPE cfp_iter4f 10 | #define ZFP_ARRAY_TYPE zfp::array4f 11 | #define ZFP_SCALAR_TYPE float 12 | 13 | #include "template/cfparray.cpp" 14 | #include "template/cfparray4.cpp" 15 | 16 | #undef CFP_ARRAY_TYPE 17 | #undef CFP_REF_TYPE 18 | #undef CFP_PTR_TYPE 19 | #undef CFP_ITER_TYPE 20 | #undef ZFP_ARRAY_TYPE 21 | #undef ZFP_SCALAR_TYPE 22 | -------------------------------------------------------------------------------- /cfp/cfpheader.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | #include "zfp/array2.hpp" 3 | #include "zfp/array3.hpp" 4 | #include "zfp/array4.hpp" 5 | #include "zfp/internal/codec/zfpheader.hpp" 6 | #include "zfp/internal/cfp/header.h" 7 | #include "zfp/internal/cfp/array1f.h" 8 | #include "zfp/internal/cfp/array1d.h" 9 | #include "zfp/internal/cfp/array2f.h" 10 | #include "zfp/internal/cfp/array2d.h" 11 | #include "zfp/internal/cfp/array3f.h" 12 | #include "zfp/internal/cfp/array3d.h" 13 | #include "zfp/internal/cfp/array4f.h" 14 | #include "zfp/internal/cfp/array4d.h" 15 | 16 | #include "template/template.h" 17 | 18 | #define CFP_HEADER_TYPE cfp_header 19 | #define ZFP_HEADER_TYPE zfp::array::header 20 | 21 | #include "template/cfpheader.cpp" 22 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | ignore: 3 | - docs/* 4 | - examples/* 5 | - src/cuda_zfp/* 6 | - src/template/cuda* 7 | - tests/* 8 | - utils/* 9 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = /usr/bin/python3 -msphinx 7 | SPHINXPROJ = zfp 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | all: 12 | @$(MAKE) html 13 | 14 | # Put it first so that "make" without argument is like "make help". 15 | help: 16 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 17 | 18 | .PHONY: help Makefile 19 | 20 | # Catch-all target: route all unknown targets to Sphinx using the new 21 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 22 | %: Makefile 23 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 24 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=python -msphinx 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | set SPHINXPROJ=zfp 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The Sphinx module was not found. Make sure you have Sphinx installed, 20 | echo.then set the SPHINXBUILD environment variable to point to the full 21 | echo.path of the 'sphinx-build' executable. Alternatively you may add the 22 | echo.Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx-fortran==1.1.1 2 | 3 | # required by sphinx-fortran but not installed on RTD 4 | six 5 | -------------------------------------------------------------------------------- /docs/source/contributors.rst: -------------------------------------------------------------------------------- 1 | .. include:: defs.rst 2 | .. _contributors: 3 | 4 | Contributors 5 | ============ 6 | 7 | * |zfp| development team 8 | 9 | - Peter Lindstrom 10 | - Danielle Asher 11 | 12 | * Major contributors 13 | 14 | - Chuck Atkins 15 | - Stephen Herbein 16 | - Mark Kim 17 | - Matt Larsen 18 | - Mark Miller 19 | - Markus Salasoo 20 | - David Wade 21 | - Haiying Xu 22 | 23 | For a full list of contributors, see the 24 | `GitHub Contributors `__ page. 25 | -------------------------------------------------------------------------------- /docs/source/disclaimer.inc: -------------------------------------------------------------------------------- 1 | .. note:: 2 | In multidimensional arrays, the order in which dimensions are specified 3 | is important. In |zfp|, the memory layout convention is such that *x* 4 | varies faster than *y*, which varies faster than *z*, and hence *x* should 5 | map to the innermost (rightmost) array dimension in a C array and to the 6 | leftmost dimension in a Fortran array. Getting the order of dimensions 7 | right is crucial for good compression and accuracy. See the discussion of 8 | :ref:`dimensions and strides ` and FAQ :ref:`#0 ` for 9 | further information. 10 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: defs.rst 2 | 3 | |zfp| |release| documentation 4 | ============================= 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | :caption: Contents 9 | 10 | introduction 11 | license 12 | installation 13 | algorithm 14 | modes 15 | execution 16 | high-level-api 17 | low-level-api 18 | bit-stream 19 | python 20 | zforp 21 | arrays 22 | cfp 23 | tutorial 24 | zfpcmd 25 | examples 26 | testing 27 | faq 28 | issues 29 | limitations 30 | directions 31 | contributors 32 | versions 33 | -------------------------------------------------------------------------------- /docs/source/requirements.txt: -------------------------------------------------------------------------------- 1 | # force older sphinx version for readthedocs build 2 | sphinx==1.6.7 3 | sphinx-fortran 4 | -------------------------------------------------------------------------------- /docs/source/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /docs/source/testing.rst: -------------------------------------------------------------------------------- 1 | .. include:: defs.rst 2 | 3 | Regression Tests 4 | ================ 5 | 6 | The :program:`testzfp` program performs basic regression testing by exercising 7 | a small but important subset of |libzfp| and the compressed-array 8 | classes. It serves as a sanity check that |zfp| has been built properly. 9 | These tests assume the default compiler settings, i.e., with none of the 10 | settings in :file:`Config` or :file:`CMakeLists.txt` modified. By default, 11 | small, synthetic floating-point arrays are used in the test. To test larger 12 | arrays, use the :code:`large` command-line option. When large arrays are 13 | used, the (de)compression throughput is also measured and reported in number 14 | of uncompressed bytes per second. 15 | 16 | More extensive unit and functional tests are available on the |zfp| GitHub 17 | `develop branch `_ in the 18 | :file:`tests` directory. 19 | -------------------------------------------------------------------------------- /docs/source/view-indexing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/zfp/7d1e3a21047a976599b562b3bbd53b1f34348f1a/docs/source/view-indexing.pdf -------------------------------------------------------------------------------- /docs/source/zfp-rounding.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/zfp/7d1e3a21047a976599b562b3bbd53b1f34348f1a/docs/source/zfp-rounding.pdf -------------------------------------------------------------------------------- /fortran/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_language(Fortran) 2 | 3 | if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") 4 | set(dialect "-ffree-form -fimplicit-none") 5 | set(bounds "-fbounds-check") 6 | endif() 7 | if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") 8 | set(dialect "-stand -free -implicitnone") 9 | set(bounds "-check bounds") 10 | endif() 11 | 12 | set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/modules) 13 | set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${bounds}") 14 | set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialect}") 15 | 16 | add_library(zFORp zfp.f90) 17 | target_link_libraries(zFORp PRIVATE zfp) 18 | 19 | set_property(TARGET zFORp PROPERTY VERSION ${ZFP_VERSION}) 20 | set_property(TARGET zFORp PROPERTY SOVERSION ${ZFP_VERSION_MAJOR}) 21 | set_property(TARGET zFORp PROPERTY OUTPUT_NAME ${ZFP_LIBRARY_PREFIX}zFORp) 22 | 23 | # install location for module file 24 | install(FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/zfp.mod 25 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 26 | 27 | # install location for library 28 | install(TARGETS zFORp EXPORT cFORp-targets 29 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 30 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 31 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 32 | -------------------------------------------------------------------------------- /fortran/Makefile: -------------------------------------------------------------------------------- 1 | include ../Config 2 | 3 | .SUFFIXES: .f90 4 | 5 | LIBDIR = ../lib 6 | MODDIR = ../modules 7 | TARGETS = $(LIBDIR)/libzFORp.a $(LIBDIR)/libzFORp.so $(MODDIR)/zfp.mod 8 | OBJECTS = zfp.o 9 | MODULES = zfp.mod 10 | 11 | static: $(LIBDIR)/libzFORp.a $(MODDIR)/zforp.mod 12 | 13 | shared: $(LIBDIR)/libzFORp.so $(MODDIR)/zforp.mod 14 | 15 | clean: 16 | rm -f $(TARGETS) $(OBJECTS) 17 | 18 | $(LIBDIR)/libzFORp.a: $(OBJECTS) 19 | mkdir -p $(LIBDIR) 20 | rm -f $@ 21 | ar rc $@ $^ 22 | 23 | $(LIBDIR)/libzFORp.so: $(OBJECTS) 24 | mkdir -p $(LIBDIR) 25 | $(FC) $(FFLAGS) -shared $^ -o $@ 26 | 27 | $(MODDIR)/zforp.mod: $(OBJECTS) 28 | mkdir -p $(MODDIR) 29 | mv $(MODULES) $(MODDIR) 30 | 31 | .f90.o: 32 | $(FC) $(FFLAGS) -c $< 33 | -------------------------------------------------------------------------------- /include/zfp/array.h: -------------------------------------------------------------------------------- 1 | #ifndef CFP_ARRAY_H 2 | #define CFP_ARRAY_H 3 | 4 | #include 5 | #include "zfp/internal/cfp/header.h" 6 | #include "zfp/internal/cfp/array1f.h" 7 | #include "zfp/internal/cfp/array1d.h" 8 | #include "zfp/internal/cfp/array2f.h" 9 | #include "zfp/internal/cfp/array2d.h" 10 | #include "zfp/internal/cfp/array3f.h" 11 | #include "zfp/internal/cfp/array3d.h" 12 | #include "zfp/internal/cfp/array4f.h" 13 | #include "zfp/internal/cfp/array4d.h" 14 | 15 | typedef struct { 16 | cfp_array1f_api array1f; 17 | cfp_array1d_api array1d; 18 | cfp_array2f_api array2f; 19 | cfp_array2d_api array2d; 20 | cfp_array3f_api array3f; 21 | cfp_array3d_api array3d; 22 | cfp_array4f_api array4f; 23 | cfp_array4d_api array4d; 24 | } cfp_api; 25 | 26 | #ifndef CFP_NAMESPACE 27 | #define CFP_NAMESPACE cfp 28 | #endif 29 | 30 | extern_ const cfp_api CFP_NAMESPACE; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/zfp/internal/array/exception.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_EXCEPTION_HPP 2 | #define ZFP_EXCEPTION_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace zfp { 8 | 9 | // generic exception thrown by array constructors 10 | class exception : public std::runtime_error { 11 | public: 12 | exception(const std::string& msg) : runtime_error(msg) {} 13 | virtual ~exception() throw() {} 14 | }; 15 | 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/zfp/internal/array/handle1.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_HANDLE1_HPP 2 | #define ZFP_HANDLE1_HPP 3 | 4 | namespace zfp { 5 | namespace internal { 6 | namespace dim1 { 7 | 8 | // forward declarations 9 | template class const_reference; 10 | template class const_pointer; 11 | template class const_iterator; 12 | template class reference; 13 | template class pointer; 14 | template class iterator; 15 | 16 | // const handle to a 1D array or view element 17 | template 18 | class const_handle { 19 | public: 20 | typedef Container container_type; 21 | typedef typename container_type::value_type value_type; 22 | 23 | protected: 24 | // protected constructor 25 | explicit const_handle(const container_type* container, size_t x) : container(const_cast(container)), x(x) {} 26 | 27 | // dereference handle 28 | value_type get() const { return container->get(x); } 29 | 30 | container_type* container; // container 31 | size_t x; // global element index 32 | }; 33 | 34 | } // dim1 35 | } // internal 36 | } // zfp 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/zfp/internal/array/handle2.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_HANDLE2_HPP 2 | #define ZFP_HANDLE2_HPP 3 | 4 | namespace zfp { 5 | namespace internal { 6 | namespace dim2 { 7 | 8 | // forward declarations 9 | template class const_reference; 10 | template class const_pointer; 11 | template class const_iterator; 12 | template class reference; 13 | template class pointer; 14 | template class iterator; 15 | 16 | // const handle to a 2D array or view element 17 | template 18 | class const_handle { 19 | public: 20 | typedef Container container_type; 21 | typedef typename container_type::value_type value_type; 22 | 23 | protected: 24 | // protected constructor 25 | explicit const_handle(const container_type* container, size_t x, size_t y) : container(const_cast(container)), x(x), y(y) {} 26 | 27 | // dereference handle 28 | value_type get() const { return container->get(x, y); } 29 | 30 | container_type* container; // container 31 | size_t x, y; // global element index 32 | }; 33 | 34 | } // dim2 35 | } // internal 36 | } // zfp 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/zfp/internal/array/handle3.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_HANDLE3_HPP 2 | #define ZFP_HANDLE3_HPP 3 | 4 | namespace zfp { 5 | namespace internal { 6 | namespace dim3 { 7 | 8 | // forward declarations 9 | template class const_reference; 10 | template class const_pointer; 11 | template class const_iterator; 12 | template class reference; 13 | template class pointer; 14 | template class iterator; 15 | 16 | // const handle to a 3D array or view element 17 | template 18 | class const_handle { 19 | public: 20 | typedef Container container_type; 21 | typedef typename container_type::value_type value_type; 22 | 23 | protected: 24 | // protected constructor 25 | explicit const_handle(const container_type* container, size_t x, size_t y, size_t z) : container(const_cast(container)), x(x), y(y), z(z) {} 26 | 27 | // dereference handle 28 | value_type get() const { return container->get(x, y, z); } 29 | 30 | container_type* container; // container 31 | size_t x, y, z; // global element index 32 | }; 33 | 34 | } // dim3 35 | } // internal 36 | } // zfp 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/zfp/internal/array/handle4.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_HANDLE4_HPP 2 | #define ZFP_HANDLE4_HPP 3 | 4 | namespace zfp { 5 | namespace internal { 6 | namespace dim4 { 7 | 8 | // forward declarations 9 | template class const_reference; 10 | template class const_pointer; 11 | template class const_iterator; 12 | template class reference; 13 | template class pointer; 14 | template class iterator; 15 | 16 | // const handle to a 4D array or view element 17 | template 18 | class const_handle { 19 | public: 20 | typedef Container container_type; 21 | typedef typename container_type::value_type value_type; 22 | 23 | protected: 24 | // protected constructor 25 | explicit const_handle(const container_type* container, size_t x, size_t y, size_t z, size_t w) : container(const_cast(container)), x(x), y(y), z(z), w(w) {} 26 | 27 | // dereference handle 28 | value_type get() const { return container->get(x, y, z, w); } 29 | 30 | container_type* container; // container 31 | size_t x, y, z, w; // global element index 32 | }; 33 | 34 | } // dim4 35 | } // internal 36 | } // zfp 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/zfp/internal/array/header.hpp: -------------------------------------------------------------------------------- 1 | // abstract base class for array header 2 | class header { 3 | public: 4 | // default constructor 5 | header() : 6 | type(zfp_type_none), 7 | nx(0), ny(0), nz(0), nw(0) 8 | {} 9 | 10 | // constructor 11 | header(const zfp::array& a) : 12 | type(a.type), 13 | nx(a.nx), ny(a.ny), nz(a.nz), nw(a.nw) 14 | {} 15 | 16 | // destructor 17 | virtual ~header() {} 18 | 19 | // array scalar type 20 | zfp_type scalar_type() const { return type; } 21 | 22 | // array dimensionality 23 | uint dimensionality() const { return nw ? 4 : nz ? 3 : ny ? 2 : nx ? 1 : 0; } 24 | 25 | // array dimensions 26 | size_t size_x() const { return nx; } 27 | size_t size_y() const { return ny; } 28 | size_t size_z() const { return nz; } 29 | size_t size_w() const { return nw; } 30 | 31 | // rate in bits per value 32 | virtual double rate() const = 0; 33 | 34 | // header payload: data pointer and byte size 35 | virtual const void* data() const = 0; 36 | virtual size_t size_bytes(uint mask = ZFP_DATA_HEADER) const = 0; 37 | 38 | protected: 39 | zfp_type type; // array scalar type 40 | size_t nx, ny, nz, nw; // array dimensions 41 | }; 42 | -------------------------------------------------------------------------------- /include/zfp/internal/array/traits.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_TRAITS_HPP 2 | #define ZFP_TRAITS_HPP 3 | 4 | namespace zfp { 5 | namespace internal { 6 | 7 | // useful type traits 8 | template 9 | struct trait; 10 | /* 11 | static const zfp_type type; // corresponding zfp type 12 | static const size_t precision; // precision in number of bits 13 | */ 14 | 15 | template <> 16 | struct trait { 17 | static const zfp_type type = zfp_type_float; 18 | static const size_t precision = CHAR_BIT * sizeof(float); 19 | }; 20 | 21 | template <> 22 | struct trait { 23 | static const zfp_type type = zfp_type_double; 24 | static const size_t precision = CHAR_BIT * sizeof(double); 25 | }; 26 | 27 | } 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/zfp/internal/cfp/header.h: -------------------------------------------------------------------------------- 1 | #ifndef CFP_HEADER_H 2 | #define CFP_HEADER_H 3 | 4 | typedef struct { 5 | void* object; 6 | } cfp_header; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/zfp/internal/zfp/inline.h: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_INLINE_H 2 | #define ZFP_INLINE_H 3 | 4 | #ifndef inline_ 5 | #if __STDC_VERSION__ >= 199901L 6 | #define inline_ static inline 7 | #else 8 | #define inline_ static 9 | #endif 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /include/zfp/internal/zfp/macros.h: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_MACROS_H 2 | #define ZFP_MACROS_H 3 | 4 | #define MIN(x, y) ((x) < (y) ? (x) : (y)) 5 | #define MAX(x, y) ((x) > (y) ? (x) : (y)) 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools", 4 | "wheel", 5 | "cython", 6 | "oldest-supported-numpy; python_version<'3.9'", 7 | 'numpy; python_version>="3.9"', 8 | ] -------------------------------------------------------------------------------- /python/requirements.txt: -------------------------------------------------------------------------------- 1 | cython>=0.22 2 | numpy>=1.8.0 3 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | include ../Config 2 | 3 | LIBDIR = ../lib 4 | TARGETS = $(LIBDIR)/libzfp.a $(LIBDIR)/libzfp.so 5 | OBJECTS = bitstream.o decode1i.o decode1l.o decode1f.o decode1d.o encode1i.o encode1l.o encode1f.o encode1d.o decode2i.o decode2l.o decode2f.o decode2d.o encode2i.o encode2l.o encode2f.o encode2d.o decode3i.o decode3l.o decode3f.o decode3d.o encode3i.o encode3l.o encode3f.o encode3d.o decode4i.o decode4l.o decode4f.o decode4d.o encode4i.o encode4l.o encode4f.o encode4d.o zfp.o 6 | 7 | static: $(LIBDIR)/libzfp.a 8 | 9 | shared: $(LIBDIR)/libzfp.so 10 | 11 | clean: 12 | rm -f $(TARGETS) $(OBJECTS) 13 | 14 | $(LIBDIR)/libzfp.a: $(OBJECTS) 15 | mkdir -p $(LIBDIR) 16 | rm -f $@ 17 | ar rc $@ $^ 18 | 19 | $(LIBDIR)/libzfp.so: $(OBJECTS) 20 | mkdir -p $(LIBDIR) 21 | $(CC) $(CFLAGS) -shared $^ -o $@ 22 | 23 | .c.o: 24 | $(CC) $(CFLAGS) -I../include -c $< 25 | -------------------------------------------------------------------------------- /src/bitstream.c: -------------------------------------------------------------------------------- 1 | #include "zfp/bitstream.h" 2 | #include "zfp/bitstream.inl" 3 | 4 | const size_t stream_word_bits = wsize; 5 | -------------------------------------------------------------------------------- /src/block1.h: -------------------------------------------------------------------------------- 1 | #define DIMS 1 2 | -------------------------------------------------------------------------------- /src/block2.h: -------------------------------------------------------------------------------- 1 | #define DIMS 2 2 | -------------------------------------------------------------------------------- /src/block3.h: -------------------------------------------------------------------------------- 1 | #define DIMS 3 2 | -------------------------------------------------------------------------------- /src/block4.h: -------------------------------------------------------------------------------- 1 | #define DIMS 4 2 | -------------------------------------------------------------------------------- /src/cuda_zfp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # file: src/cuZFP/CMakeLists.txt 4 | # 5 | ############################################################################### 6 | 7 | set(cuZFP_sources 8 | cuZFP.cu # main entry point 9 | decode.cuh 10 | decode1.cuh 11 | decode2.cuh 12 | decode3.cuh 13 | encode.cuh 14 | encode1.cuh 15 | encode2.cuh 16 | encode3.cuh 17 | pointers.cuh 18 | type_info.cuh) 19 | 20 | set(cuZFP_headers 21 | shared.h 22 | cuZFP.h 23 | ErrorCheck.h) 24 | 25 | -------------------------------------------------------------------------------- /src/cuda_zfp/ErrorCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRORCHECK_H 2 | #define ERRORCHECK_H 3 | #include 4 | #include 5 | #include 6 | 7 | using std::stringstream; 8 | class ErrorCheck 9 | { 10 | public: 11 | ErrorCheck() 12 | { 13 | 14 | } 15 | 16 | void chk(std::string msg) 17 | { 18 | error = cudaGetLastError(); 19 | if (error != cudaSuccess) 20 | { 21 | std::cout << msg << " : " << error; 22 | std::cout << " " << cudaGetErrorString(error) << std::endl; 23 | } 24 | } 25 | 26 | void chk() 27 | { 28 | chk(str.str()); 29 | str.str(""); 30 | } 31 | cudaError error; 32 | stringstream str; 33 | }; 34 | 35 | #endif // ERRORCHECK_H 36 | -------------------------------------------------------------------------------- /src/cuda_zfp/cuZFP.h: -------------------------------------------------------------------------------- 1 | #ifndef cuZFP_h 2 | #define cuZFP_h 3 | 4 | #include "zfp.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | size_t cuda_compress(zfp_stream *stream, const zfp_field *field); 10 | void cuda_decompress(zfp_stream *stream, zfp_field *field); 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/cuda_zfp/pointers.cuh: -------------------------------------------------------------------------------- 1 | #ifndef CUZFP_POINTERS_CUH 2 | #define CUZFP_POINTERS_CUH 3 | 4 | #include "ErrorCheck.h" 5 | #include 6 | 7 | 8 | namespace cuZFP 9 | { 10 | // https://gitlab.kitware.com/third-party/nvpipe/blob/master/encode.c 11 | bool is_gpu_ptr(const void *ptr) 12 | { 13 | cudaPointerAttributes atts; 14 | const cudaError_t perr = cudaPointerGetAttributes(&atts, ptr); 15 | 16 | // clear last error so other error checking does 17 | // not pick it up 18 | cudaError_t error = cudaGetLastError(); 19 | #if CUDART_VERSION >= 10000 20 | return perr == cudaSuccess && 21 | (atts.type == cudaMemoryTypeDevice || 22 | atts.type == cudaMemoryTypeManaged); 23 | #else 24 | return perr == cudaSuccess && atts.memoryType == cudaMemoryTypeDevice; 25 | #endif 26 | } 27 | 28 | } // namespace cuZFP 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/decode1d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec1.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode1.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode1.c" 19 | -------------------------------------------------------------------------------- /src/decode1f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec1.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode1.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode1.c" 19 | -------------------------------------------------------------------------------- /src/decode1i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec1.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode1.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode1.c" 16 | -------------------------------------------------------------------------------- /src/decode1l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec1.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode1.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode1.c" 16 | -------------------------------------------------------------------------------- /src/decode2d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec2.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode2.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode2.c" 19 | -------------------------------------------------------------------------------- /src/decode2f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec2.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode2.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode2.c" 19 | -------------------------------------------------------------------------------- /src/decode2i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec2.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode2.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode2.c" 16 | -------------------------------------------------------------------------------- /src/decode2l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec2.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode2.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode2.c" 16 | -------------------------------------------------------------------------------- /src/decode3d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec3.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode3.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode3.c" 19 | -------------------------------------------------------------------------------- /src/decode3f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec3.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode3.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode3.c" 19 | -------------------------------------------------------------------------------- /src/decode3i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec3.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode3.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode3.c" 16 | -------------------------------------------------------------------------------- /src/decode3l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec3.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode3.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode3.c" 16 | -------------------------------------------------------------------------------- /src/decode4d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec4.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode4.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode4.c" 19 | -------------------------------------------------------------------------------- /src/decode4f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec4.c" 12 | #include "template/decode.c" 13 | #include "template/decodef.c" 14 | #include "template/decode4.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revdecode.c" 17 | #include "template/revdecodef.c" 18 | #include "template/revdecode4.c" 19 | -------------------------------------------------------------------------------- /src/decode4i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec4.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode4.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode4.c" 16 | -------------------------------------------------------------------------------- /src/decode4l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec4.c" 11 | #include "template/decode.c" 12 | #include "template/decodei.c" 13 | #include "template/decode4.c" 14 | #include "template/revdecode.c" 15 | #include "template/revdecode4.c" 16 | -------------------------------------------------------------------------------- /src/encode1d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec1.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode1.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode1.c" 19 | -------------------------------------------------------------------------------- /src/encode1f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec1.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode1.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode1.c" 19 | -------------------------------------------------------------------------------- /src/encode1i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec1.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode1.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode1.c" 16 | -------------------------------------------------------------------------------- /src/encode1l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block1.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec1.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode1.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode1.c" 16 | -------------------------------------------------------------------------------- /src/encode2d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec2.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode2.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode2.c" 19 | -------------------------------------------------------------------------------- /src/encode2f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec2.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode2.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode2.c" 19 | -------------------------------------------------------------------------------- /src/encode2i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec2.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode2.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode2.c" 16 | -------------------------------------------------------------------------------- /src/encode2l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block2.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec2.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode2.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode2.c" 16 | -------------------------------------------------------------------------------- /src/encode3d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec3.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode3.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode3.c" 19 | -------------------------------------------------------------------------------- /src/encode3f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec3.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode3.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode3.c" 19 | -------------------------------------------------------------------------------- /src/encode3i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec3.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode3.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode3.c" 16 | -------------------------------------------------------------------------------- /src/encode3l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block3.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec3.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode3.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode3.c" 16 | -------------------------------------------------------------------------------- /src/encode4d.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsd.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec4.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode4.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode4.c" 19 | -------------------------------------------------------------------------------- /src/encode4f.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsf.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codecf.c" 11 | #include "template/codec4.c" 12 | #include "template/encode.c" 13 | #include "template/encodef.c" 14 | #include "template/encode4.c" 15 | #include "template/revcodecf.c" 16 | #include "template/revencode.c" 17 | #include "template/revencodef.c" 18 | #include "template/revencode4.c" 19 | -------------------------------------------------------------------------------- /src/encode4i.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsi.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec4.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode4.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode4.c" 16 | -------------------------------------------------------------------------------- /src/encode4l.c: -------------------------------------------------------------------------------- 1 | #include "zfp/internal/zfp/inline.h" 2 | #include "zfp.h" 3 | #include "zfp/internal/zfp/macros.h" 4 | #include "block4.h" 5 | #include "traitsl.h" 6 | #include "template/template.h" 7 | #include "template/codec.h" 8 | #include "zfp/bitstream.inl" 9 | #include "template/codec.c" 10 | #include "template/codec4.c" 11 | #include "template/encode.c" 12 | #include "template/encodei.c" 13 | #include "template/encode4.c" 14 | #include "template/revencode.c" 15 | #include "template/revencode4.c" 16 | -------------------------------------------------------------------------------- /src/share/omp.c: -------------------------------------------------------------------------------- 1 | #ifdef _OPENMP 2 | #include 3 | #include 4 | #include "zfp.h" 5 | 6 | /* number of omp threads to use */ 7 | static uint 8 | thread_count_omp(const zfp_stream* stream) 9 | { 10 | uint count = zfp_stream_omp_threads(stream); 11 | /* if no thread count is specified, use default number of threads */ 12 | if (!count) 13 | count = omp_get_max_threads(); 14 | return count; 15 | } 16 | 17 | /* number of chunks to partition array into */ 18 | static size_t 19 | chunk_count_omp(const zfp_stream* stream, size_t blocks, uint threads) 20 | { 21 | size_t chunk_size = (size_t)zfp_stream_omp_chunk_size(stream); 22 | /* if no chunk size is specified, assign one chunk per thread */ 23 | size_t chunks = chunk_size ? (blocks + chunk_size - 1) / chunk_size : threads; 24 | /* each chunk must contain at least one block */ 25 | chunks = MIN(chunks, blocks); 26 | /* OpenMP 2.0 loop counters must be ints */ 27 | chunks = MIN(chunks, INT_MAX); 28 | return chunks; 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/template/codec.c: -------------------------------------------------------------------------------- 1 | /* true if max compressed size exceeds maxbits */ 2 | static int 3 | with_maxbits(uint maxbits, uint maxprec, uint size) 4 | { 5 | return (maxprec + 1) * size - 1 > maxbits; 6 | } 7 | -------------------------------------------------------------------------------- /src/template/codec.h: -------------------------------------------------------------------------------- 1 | #define PERM _t1(perm, DIMS) /* coefficient order */ 2 | #define BLOCK_SIZE (1 << (2 * DIMS)) /* values per block */ 3 | #define EBIAS ((1 << (EBITS - 1)) - 1) /* exponent bias */ 4 | #define REVERSIBLE(zfp) ((zfp)->minexp < ZFP_MIN_EXP) /* reversible mode? */ 5 | -------------------------------------------------------------------------------- /src/template/codec1.c: -------------------------------------------------------------------------------- 1 | /* order coefficients by polynomial degree/frequency */ 2 | cache_align_(static const uchar perm_1[4]) = { 3 | 0, 1, 2, 3 4 | }; 5 | -------------------------------------------------------------------------------- /src/template/codec2.c: -------------------------------------------------------------------------------- 1 | #define index(i, j) ((i) + 4 * (j)) 2 | 3 | /* order coefficients (i, j) by i + j, then i^2 + j^2 */ 4 | cache_align_(static const uchar perm_2[16]) = { 5 | index(0, 0), /* 0 : 0 */ 6 | 7 | index(1, 0), /* 1 : 1 */ 8 | index(0, 1), /* 2 : 1 */ 9 | 10 | index(1, 1), /* 3 : 2 */ 11 | 12 | index(2, 0), /* 4 : 2 */ 13 | index(0, 2), /* 5 : 2 */ 14 | 15 | index(2, 1), /* 6 : 3 */ 16 | index(1, 2), /* 7 : 3 */ 17 | 18 | index(3, 0), /* 8 : 3 */ 19 | index(0, 3), /* 9 : 3 */ 20 | 21 | index(2, 2), /* 10 : 4 */ 22 | 23 | index(3, 1), /* 11 : 4 */ 24 | index(1, 3), /* 12 : 4 */ 25 | 26 | index(3, 2), /* 13 : 5 */ 27 | index(2, 3), /* 14 : 5 */ 28 | 29 | index(3, 3), /* 15 : 6 */ 30 | }; 31 | 32 | #undef index 33 | -------------------------------------------------------------------------------- /src/template/codecf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* maximum number of bit planes to encode */ 5 | static uint 6 | precision(int maxexp, uint maxprec, int minexp, int dims) 7 | { 8 | #if (ZFP_ROUNDING_MODE != ZFP_ROUND_NEVER) && defined(ZFP_WITH_TIGHT_ERROR) 9 | return MIN(maxprec, (uint)MAX(0, maxexp - minexp + 2 * dims + 1)); 10 | #else 11 | return MIN(maxprec, (uint)MAX(0, maxexp - minexp + 2 * dims + 2)); 12 | #endif 13 | } 14 | 15 | /* map integer x relative to exponent e to floating-point number */ 16 | static Scalar 17 | _t1(dequantize, Scalar)(Int x, int e) 18 | { 19 | return LDEXP((Scalar)x, e - ((int)(CHAR_BIT * sizeof(Scalar)) - 2)); 20 | } 21 | 22 | /* inverse block-floating-point transform from signed integers */ 23 | static void 24 | _t1(inv_cast, Scalar)(const Int* iblock, Scalar* fblock, uint n, int emax) 25 | { 26 | /* compute power-of-two scale factor s */ 27 | Scalar s = _t1(dequantize, Scalar)(1, emax); 28 | /* compute p-bit float x = s*y where |y| <= 2^(p-2) - 1 */ 29 | do 30 | *fblock++ = (Scalar)(s * *iblock++); 31 | while (--n); 32 | } 33 | -------------------------------------------------------------------------------- /src/template/cudacompress.c: -------------------------------------------------------------------------------- 1 | #ifdef ZFP_WITH_CUDA 2 | 3 | #include "../cuda_zfp/cuZFP.h" 4 | 5 | static void 6 | _t2(compress_cuda, Scalar, 1)(zfp_stream* stream, const zfp_field* field) 7 | { 8 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 9 | cuda_compress(stream, field); 10 | } 11 | 12 | /* compress 1d strided array */ 13 | static void 14 | _t2(compress_strided_cuda, Scalar, 1)(zfp_stream* stream, const zfp_field* field) 15 | { 16 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 17 | cuda_compress(stream, field); 18 | } 19 | 20 | /* compress 2d strided array */ 21 | static void 22 | _t2(compress_strided_cuda, Scalar, 2)(zfp_stream* stream, const zfp_field* field) 23 | { 24 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 25 | cuda_compress(stream, field); 26 | } 27 | 28 | /* compress 3d strided array */ 29 | static void 30 | _t2(compress_strided_cuda, Scalar, 3)(zfp_stream* stream, const zfp_field* field) 31 | { 32 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 33 | cuda_compress(stream, field); 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/template/cudadecompress.c: -------------------------------------------------------------------------------- 1 | #ifdef ZFP_WITH_CUDA 2 | 3 | #include "../cuda_zfp/cuZFP.h" 4 | 5 | static void 6 | _t2(decompress_cuda, Scalar, 1)(zfp_stream* stream, zfp_field* field) 7 | { 8 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 9 | cuda_decompress(stream, field); 10 | } 11 | 12 | /* compress 1d strided array */ 13 | static void 14 | _t2(decompress_strided_cuda, Scalar, 1)(zfp_stream* stream, zfp_field* field) 15 | { 16 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 17 | cuda_decompress(stream, field); 18 | } 19 | 20 | /* compress 2d strided array */ 21 | static void 22 | _t2(decompress_strided_cuda, Scalar, 2)(zfp_stream* stream, zfp_field* field) 23 | { 24 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 25 | cuda_decompress(stream, field); 26 | } 27 | 28 | /* compress 3d strided array */ 29 | static void 30 | _t2(decompress_strided_cuda, Scalar, 3)(zfp_stream* stream, zfp_field* field) 31 | { 32 | if (zfp_stream_compression_mode(stream) == zfp_mode_fixed_rate) 33 | cuda_decompress(stream, field); 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/template/decodei.c: -------------------------------------------------------------------------------- 1 | static uint _t2(rev_decode_block, Int, DIMS)(bitstream* stream, uint minbits, uint maxbits, Int* iblock); 2 | 3 | /* public functions -------------------------------------------------------- */ 4 | 5 | /* decode contiguous integer block */ 6 | size_t 7 | _t2(zfp_decode_block, Int, DIMS)(zfp_stream* zfp, Int* iblock) 8 | { 9 | return REVERSIBLE(zfp) ? _t2(rev_decode_block, Int, DIMS)(zfp->stream, zfp->minbits, zfp->maxbits, iblock) : _t2(decode_block, Int, DIMS)(zfp->stream, zfp->minbits, zfp->maxbits, zfp->maxprec, iblock); 10 | } 11 | -------------------------------------------------------------------------------- /src/template/encodei.c: -------------------------------------------------------------------------------- 1 | static uint _t2(rev_encode_block, Int, DIMS)(bitstream* stream, uint minbits, uint maxbits, uint maxprec, Int* iblock); 2 | 3 | /* public functions -------------------------------------------------------- */ 4 | 5 | /* encode contiguous integer block */ 6 | size_t 7 | _t2(zfp_encode_block, Int, DIMS)(zfp_stream* zfp, const Int* iblock) 8 | { 9 | cache_align_(Int block[BLOCK_SIZE]); 10 | uint i; 11 | /* copy block */ 12 | for (i = 0; i < BLOCK_SIZE; i++) 13 | block[i] = iblock[i]; 14 | return REVERSIBLE(zfp) ? _t2(rev_encode_block, Int, DIMS)(zfp->stream, zfp->minbits, zfp->maxbits, zfp->maxprec, block) : _t2(encode_block, Int, DIMS)(zfp->stream, zfp->minbits, zfp->maxbits, zfp->maxprec, block); 15 | } 16 | -------------------------------------------------------------------------------- /src/template/revcodecf.c: -------------------------------------------------------------------------------- 1 | /* inverse block-floating-point transform from signed integers */ 2 | static void 3 | _t1(rev_inv_cast, Scalar)(const Int* iblock, Scalar* fblock, uint n, int emax) 4 | { 5 | /* test for all-zero block, which needs special treatment */ 6 | if (emax != -EBIAS) 7 | _t1(inv_cast, Scalar)(iblock, fblock, n, emax); 8 | else 9 | while (n--) 10 | *fblock++ = 0; 11 | } 12 | -------------------------------------------------------------------------------- /src/template/revdecode1.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible inverse decorrelating 1D transform */ 4 | static void 5 | _t2(rev_inv_xform, Int, 1)(Int* p) 6 | { 7 | /* transform along x */ 8 | _t1(rev_inv_lift, Int)(p, 1); 9 | } 10 | -------------------------------------------------------------------------------- /src/template/revdecode2.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible inverse decorrelating 2D transform */ 4 | static void 5 | _t2(rev_inv_xform, Int, 2)(Int* p) 6 | { 7 | uint x, y; 8 | /* transform along y */ 9 | for (x = 0; x < 4; x++) 10 | _t1(rev_inv_lift, Int)(p + 1 * x, 4); 11 | /* transform along x */ 12 | for (y = 0; y < 4; y++) 13 | _t1(rev_inv_lift, Int)(p + 4 * y, 1); 14 | } 15 | -------------------------------------------------------------------------------- /src/template/revdecode3.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible inverse decorrelating 3D transform */ 4 | static void 5 | _t2(rev_inv_xform, Int, 3)(Int* p) 6 | { 7 | uint x, y, z; 8 | /* transform along z */ 9 | for (y = 0; y < 4; y++) 10 | for (x = 0; x < 4; x++) 11 | _t1(rev_inv_lift, Int)(p + 1 * x + 4 * y, 16); 12 | /* transform along y */ 13 | for (x = 0; x < 4; x++) 14 | for (z = 0; z < 4; z++) 15 | _t1(rev_inv_lift, Int)(p + 16 * z + 1 * x, 4); 16 | /* transform along x */ 17 | for (z = 0; z < 4; z++) 18 | for (y = 0; y < 4; y++) 19 | _t1(rev_inv_lift, Int)(p + 4 * y + 16 * z, 1); 20 | } 21 | -------------------------------------------------------------------------------- /src/template/revdecode4.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible inverse decorrelating 4D transform */ 4 | static void 5 | _t2(rev_inv_xform, Int, 4)(Int* p) 6 | { 7 | uint x, y, z, w; 8 | /* transform along w */ 9 | for (z = 0; z < 4; z++) 10 | for (y = 0; y < 4; y++) 11 | for (x = 0; x < 4; x++) 12 | _t1(rev_inv_lift, Int)(p + 1 * x + 4 * y + 16 * z, 64); 13 | /* transform along z */ 14 | for (y = 0; y < 4; y++) 15 | for (x = 0; x < 4; x++) 16 | for (w = 0; w < 4; w++) 17 | _t1(rev_inv_lift, Int)(p + 64 * w + 1 * x + 4 * y, 16); 18 | /* transform along y */ 19 | for (x = 0; x < 4; x++) 20 | for (w = 0; w < 4; w++) 21 | for (z = 0; z < 4; z++) 22 | _t1(rev_inv_lift, Int)(p + 16 * z + 64 * w + 1 * x, 4); 23 | /* transform along x */ 24 | for (w = 0; w < 4; w++) 25 | for (z = 0; z < 4; z++) 26 | for (y = 0; y < 4; y++) 27 | _t1(rev_inv_lift, Int)(p + 4 * y + 16 * z + 64 * w, 1); 28 | } 29 | -------------------------------------------------------------------------------- /src/template/revencode1.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible forward decorrelating 1D transform */ 4 | static void 5 | _t2(rev_fwd_xform, Int, 1)(Int* p) 6 | { 7 | /* transform along x */ 8 | _t1(rev_fwd_lift, Int)(p, 1); 9 | } 10 | -------------------------------------------------------------------------------- /src/template/revencode2.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible forward decorrelating 2D transform */ 4 | static void 5 | _t2(rev_fwd_xform, Int, 2)(Int* p) 6 | { 7 | uint x, y; 8 | /* transform along x */ 9 | for (y = 0; y < 4; y++) 10 | _t1(rev_fwd_lift, Int)(p + 4 * y, 1); 11 | /* transform along y */ 12 | for (x = 0; x < 4; x++) 13 | _t1(rev_fwd_lift, Int)(p + 1 * x, 4); 14 | } 15 | -------------------------------------------------------------------------------- /src/template/revencode3.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible forward decorrelating 3D transform */ 4 | static void 5 | _t2(rev_fwd_xform, Int, 3)(Int* p) 6 | { 7 | uint x, y, z; 8 | /* transform along x */ 9 | for (z = 0; z < 4; z++) 10 | for (y = 0; y < 4; y++) 11 | _t1(rev_fwd_lift, Int)(p + 4 * y + 16 * z, 1); 12 | /* transform along y */ 13 | for (x = 0; x < 4; x++) 14 | for (z = 0; z < 4; z++) 15 | _t1(rev_fwd_lift, Int)(p + 16 * z + 1 * x, 4); 16 | /* transform along z */ 17 | for (y = 0; y < 4; y++) 18 | for (x = 0; x < 4; x++) 19 | _t1(rev_fwd_lift, Int)(p + 1 * x + 4 * y, 16); 20 | } 21 | -------------------------------------------------------------------------------- /src/template/revencode4.c: -------------------------------------------------------------------------------- 1 | /* private functions ------------------------------------------------------- */ 2 | 3 | /* reversible forward decorrelating 4D transform */ 4 | static void 5 | _t2(rev_fwd_xform, Int, 4)(Int* p) 6 | { 7 | uint x, y, z, w; 8 | /* transform along x */ 9 | for (w = 0; w < 4; w++) 10 | for (z = 0; z < 4; z++) 11 | for (y = 0; y < 4; y++) 12 | _t1(rev_fwd_lift, Int)(p + 4 * y + 16 * z + 64 * w, 1); 13 | /* transform along y */ 14 | for (x = 0; x < 4; x++) 15 | for (w = 0; w < 4; w++) 16 | for (z = 0; z < 4; z++) 17 | _t1(rev_fwd_lift, Int)(p + 16 * z + 64 * w + 1 * x, 4); 18 | /* transform along z */ 19 | for (y = 0; y < 4; y++) 20 | for (x = 0; x < 4; x++) 21 | for (w = 0; w < 4; w++) 22 | _t1(rev_fwd_lift, Int)(p + 64 * w + 1 * x + 4 * y, 16); 23 | /* transform along w */ 24 | for (z = 0; z < 4; z++) 25 | for (y = 0; y < 4; y++) 26 | for (x = 0; x < 4; x++) 27 | _t1(rev_fwd_lift, Int)(p + 1 * x + 4 * y + 16 * z, 64); 28 | } 29 | -------------------------------------------------------------------------------- /src/template/template.h: -------------------------------------------------------------------------------- 1 | #ifndef TEMPLATE_H 2 | #define TEMPLATE_H 3 | 4 | /* concatenation */ 5 | #define _cat2(x, y) x ## _ ## y 6 | #define _cat3(x, y, z) x ## _ ## y ## _ ## z 7 | 8 | /* 1- and 2-argument function templates */ 9 | #define _t1(function, arg) _cat2(function, arg) 10 | #define _t2(function, type, dims) _cat3(function, type, dims) 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/traitsd.h: -------------------------------------------------------------------------------- 1 | /* double-precision floating-point traits */ 2 | 3 | #define Scalar double /* floating-point type */ 4 | #define Int int64 /* corresponding signed integer type */ 5 | #define UInt uint64 /* corresponding unsigned integer type */ 6 | #define EBITS 11 /* number of exponent bits */ 7 | #define PBITS 6 /* number of bits needed to encode precision */ 8 | #define NBMASK UINT64C(0xaaaaaaaaaaaaaaaa) /* negabinary mask */ 9 | #define TCMASK UINT64C(0x7fffffffffffffff) /* two's complement mask */ 10 | #define SCALAR_MIN DBL_MIN /* smallest positive normal number */ 11 | 12 | #define FABS(x) fabs(x) 13 | #define FREXP(x, e) frexp(x, e) 14 | #define LDEXP(x, e) ldexp(x, e) 15 | -------------------------------------------------------------------------------- /src/traitsf.h: -------------------------------------------------------------------------------- 1 | /* single-precision floating-point traits */ 2 | 3 | #define Scalar float /* floating-point type */ 4 | #define Int int32 /* corresponding signed integer type */ 5 | #define UInt uint32 /* corresponding unsigned integer type */ 6 | #define EBITS 8 /* number of exponent bits */ 7 | #define PBITS 5 /* number of bits needed to encode precision */ 8 | #define NBMASK 0xaaaaaaaau /* negabinary mask */ 9 | #define TCMASK 0x7fffffffu /* two's complement mask */ 10 | #define SCALAR_MIN FLT_MIN /* smallest positive normal number */ 11 | 12 | #if __STDC_VERSION__ >= 199901L 13 | #define FABS(x) fabsf(x) 14 | #define FREXP(x, e) frexpf(x, e) 15 | #define LDEXP(x, e) ldexpf(x, e) 16 | #else 17 | #define FABS(x) (float)fabs(x) 18 | #define FREXP(x, e) (void)frexp(x, e) 19 | #define LDEXP(x, e) (float)ldexp(x, e) 20 | #endif 21 | -------------------------------------------------------------------------------- /src/traitsi.h: -------------------------------------------------------------------------------- 1 | /* 32-bit integer traits */ 2 | 3 | #define Scalar int32 /* integer type */ 4 | #define Int int32 /* corresponding signed integer type */ 5 | #define UInt uint32 /* corresponding unsigned integer type */ 6 | #define PBITS 5 /* number of bits needed to encode precision */ 7 | #define NBMASK 0xaaaaaaaau /* negabinary mask */ 8 | -------------------------------------------------------------------------------- /src/traitsl.h: -------------------------------------------------------------------------------- 1 | /* 64-bit integer traits */ 2 | 3 | #define Scalar int64 /* integer type */ 4 | #define Int int64 /* corresponding signed integer type */ 5 | #define UInt uint64 /* corresponding unsigned integer type */ 6 | #define PBITS 6 /* number of bits needed to encode precision */ 7 | #define NBMASK UINT64C(0xaaaaaaaaaaaaaaaa) /* negabinary mask */ 8 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt.in: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.7) 2 | 3 | project(googletest-download NONE) 4 | 5 | include(ExternalProject) 6 | ExternalProject_Add( 7 | googletest 8 | GIT_REPOSITORY https://github.com/google/googletest.git 9 | GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 #703bd9caab50b139428cea1aaff9974ebee5742e 10 | SOURCE_DIR "${ZFP_BINARY_DIR}/tests/googletest-src" 11 | BINARY_DIR "${ZFP_BINARY_DIR}/tests/googletest-build" 12 | CONFIGURE_COMMAND "" 13 | BUILD_COMMAND "" 14 | INSTALL_COMMAND "" 15 | TEST_COMMAND "" 16 | ) 17 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | include ../Config 2 | 3 | BINDIR = ../bin 4 | TARGETS = $(BINDIR)/testzfp $(BINDIR)/testviews 5 | INCS = -I../include 6 | LIBS = -L../lib -lzfp $(LDFLAGS) 7 | 8 | all: $(TARGETS) 9 | 10 | $(BINDIR)/testzfp: testzfp.cpp ../lib/$(LIBZFP) 11 | $(CXX) $(CXXFLAGS) $(INCS) testzfp.cpp $(LIBS) -o $@ 12 | 13 | $(BINDIR)/testviews: testviews.cpp ../lib/$(LIBZFP) 14 | $(CXX) $(CXXFLAGS) $(INCS) testviews.cpp $(LIBS) -o $@ 15 | 16 | test: $(BINDIR)/testzfp 17 | $(BINDIR)/testzfp 18 | 19 | clean: 20 | rm -f $(TARGETS) 21 | -------------------------------------------------------------------------------- /tests/array/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | add_subdirectory(array) 4 | add_subdirectory(constArray) 5 | add_subdirectory(decode) 6 | add_subdirectory(encode) 7 | add_subdirectory(zfp) 8 | -------------------------------------------------------------------------------- /tests/array/array/testArray1RefsBase.cpp: -------------------------------------------------------------------------------- 1 | TEST_F(ARRAY_DIMS_SCALAR_TEST_REFS, when_resize_then_sizeChanges) 2 | { 3 | EXPECT_EQ(ARRAY_SIZE, arr.size()); 4 | 5 | size_t newLen = ARRAY_SIZE + 1; 6 | arr.resize(newLen); 7 | 8 | EXPECT_EQ(newLen, arr.size()); 9 | } 10 | 11 | TEST_F(ARRAY_DIMS_SCALAR_TEST_REFS, when_getIndexWithParentheses_then_refReturned) 12 | { 13 | size_t i = 1; 14 | arr(i) = VAL; 15 | 16 | EXPECT_EQ(VAL, arr(i)); 17 | } 18 | 19 | TEST_F(ARRAY_DIMS_SCALAR_TEST_REFS, given_constCompressedArray_when_getIndexWithBrackets_then_valReturned) 20 | { 21 | size_t i = 1; 22 | arr[i] = VAL; 23 | 24 | const array1 arrConst = arr; 25 | 26 | EXPECT_EQ(VAL, arrConst[i]); 27 | } 28 | 29 | TEST_F(ARRAY_DIMS_SCALAR_TEST_REFS, given_constCompressedArray_when_getIndexWithParentheses_then_valReturned) 30 | { 31 | size_t i = 1; 32 | arr[i] = VAL; 33 | 34 | const array1 arrConst = arr; 35 | 36 | EXPECT_EQ(VAL, arrConst(i)); 37 | } 38 | -------------------------------------------------------------------------------- /tests/array/array/testArray1dIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array1dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array1dTestIters 6 | 7 | #include "utils/gtest1dTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray1ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray1dPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array1dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array1dTestPtrs 6 | 7 | #include "utils/gtest1dTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | -------------------------------------------------------------------------------- /tests/array/array/testArray1dRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array1dTestRefs 10 | 11 | #include "utils/gtest1dTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray1RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray1dViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array1dTestViewIters 10 | 11 | #include "utils/gtest1dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array1d 14 | #define SCALAR double 15 | #define DIMS 1 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray1dViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array1dTestViewPtrs 10 | 11 | #include "utils/gtest1dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array1d 14 | #define SCALAR double 15 | #define DIMS 1 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray1dViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array1dTestViews 10 | 11 | #include "utils/gtest1dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array1d 14 | #define SCALAR double 15 | #define DIMS 1 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray1ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/array/testArray1f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | #include "zfp/array3.hpp" 3 | #include "zfp/array4.hpp" 4 | #include "zfp/factory.hpp" 5 | #include "zfp/array2.hpp" 6 | using namespace zfp; 7 | 8 | extern "C" { 9 | #include "constants/1dFloat.h" 10 | } 11 | 12 | #include "gtest/gtest.h" 13 | #include "utils/gtestFloatEnv.h" 14 | #include "utils/gtestBaseFixture.h" 15 | #include "utils/predicates.h" 16 | 17 | class Array1fTestEnv : public ArrayFloatTestEnv { 18 | public: 19 | virtual int getDims() { return 1; } 20 | }; 21 | 22 | Array1fTestEnv* const testEnv = new Array1fTestEnv; 23 | 24 | class Array1fTest : public ArrayNdTestFixture {}; 25 | 26 | #define TEST_FIXTURE Array1fTest 27 | 28 | #define ZFP_ARRAY_TYPE array1f 29 | #define ZFP_ARRAY_TYPE_WRONG_SCALAR array1d 30 | #define ZFP_ARRAY_TYPE_WRONG_DIM array2f 31 | #define ZFP_ARRAY_TYPE_WRONG_SCALAR_DIM array2d 32 | #define ZFP_ARRAY_NOT_INCLUDED_TYPE array3f 33 | 34 | #define UINT uint32 35 | #define SCALAR float 36 | #define DIMS 1 37 | 38 | #include "testArrayBase.cpp" 39 | #include "testArray1Base.cpp" 40 | 41 | int main(int argc, char* argv[]) { 42 | ::testing::InitGoogleTest(&argc, argv); 43 | static_cast(::testing::AddGlobalTestEnvironment(testEnv)); 44 | return RUN_ALL_TESTS(); 45 | } 46 | -------------------------------------------------------------------------------- /tests/array/array/testArray1fIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array1fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array1fTestIters 6 | 7 | #include "utils/gtest1fTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray1ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray1fPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array1fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array1fTestPtrs 6 | 7 | #include "utils/gtest1fTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | -------------------------------------------------------------------------------- /tests/array/array/testArray1fRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array1fTestRefs 10 | 11 | #include "utils/gtest1fTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray1RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray1fViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array1fTestViewIters 10 | 11 | #include "utils/gtest1fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array1f 14 | #define SCALAR float 15 | #define DIMS 1 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray1fViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array1fTestViewPtrs 10 | 11 | #include "utils/gtest1fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array1f 14 | #define SCALAR float 15 | #define DIMS 1 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray1fViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array1fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array1fTestViews 10 | 11 | #include "utils/gtest1fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array1f 14 | #define SCALAR float 15 | #define DIMS 1 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray1ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/array/testArray2PtrsBase.cpp: -------------------------------------------------------------------------------- 1 | TEST_F(ARRAY_DIMS_SCALAR_TEST_PTRS, given_pointerAtXBoundary_when_increment_then_pointerPositionTraversesCorrectly) 2 | { 3 | size_t i = arr.size_x() - 1; 4 | size_t j = 2; 5 | arr(0, j+1) = VAL; 6 | 7 | ptr = &arr(i, j); 8 | 9 | EXPECT_EQ(VAL, *++ptr); 10 | } 11 | 12 | TEST_F(ARRAY_DIMS_SCALAR_TEST_PTRS, given_pointerAtXBoundary_when_decrement_then_pointerPositionTraversesCorrectly) 13 | { 14 | size_t i = 0; 15 | size_t j = 2; 16 | 17 | size_t iNext = arr.size_x() - 1; 18 | arr(iNext, j-1) = VAL; 19 | 20 | ptr = &arr(i, j); 21 | 22 | EXPECT_EQ(VAL, *--ptr); 23 | } 24 | -------------------------------------------------------------------------------- /tests/array/array/testArray2dIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array2dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array2dTestIters 6 | 7 | #include "utils/gtest2dTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray2ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray2dPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array2dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array2dTestPtrs 6 | 7 | #include "utils/gtest2dTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | #include "testArray2PtrsBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray2dRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array2dTestRefs 10 | 11 | #include "utils/gtest2dTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray2RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray2dViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array2dTestViewIters 10 | 11 | #include "utils/gtest2dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array2d 14 | #define SCALAR double 15 | #define DIMS 2 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray2dViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array2dTestViewPtrs 10 | 11 | #include "utils/gtest2dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array2d 14 | #define SCALAR double 15 | #define DIMS 2 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray2dViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array2dTestViews 10 | 11 | #include "utils/gtest2dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array2d 14 | #define SCALAR double 15 | #define DIMS 2 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray2ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/array/testArray2f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | #include "zfp/array2.hpp" 3 | #include "zfp/array4.hpp" 4 | #include "zfp/factory.hpp" 5 | #include "zfp/array3.hpp" 6 | using namespace zfp; 7 | 8 | extern "C" { 9 | #include "constants/2dFloat.h" 10 | } 11 | 12 | #include "gtest/gtest.h" 13 | #include "utils/gtestFloatEnv.h" 14 | #include "utils/gtestBaseFixture.h" 15 | #include "utils/predicates.h" 16 | 17 | class Array2fTestEnv : public ArrayFloatTestEnv { 18 | public: 19 | virtual int getDims() { return 2; } 20 | }; 21 | 22 | Array2fTestEnv* const testEnv = new Array2fTestEnv; 23 | 24 | class Array2fTest : public ArrayNdTestFixture {}; 25 | 26 | #define TEST_FIXTURE Array2fTest 27 | 28 | #define ZFP_ARRAY_TYPE array2f 29 | #define ZFP_ARRAY_TYPE_WRONG_SCALAR array2d 30 | #define ZFP_ARRAY_TYPE_WRONG_DIM array3f 31 | #define ZFP_ARRAY_TYPE_WRONG_SCALAR_DIM array3d 32 | #define ZFP_ARRAY_NOT_INCLUDED_TYPE array1f 33 | 34 | #define UINT uint32 35 | #define SCALAR float 36 | #define DIMS 2 37 | 38 | #include "testArrayBase.cpp" 39 | #include "testArray2Base.cpp" 40 | 41 | int main(int argc, char* argv[]) { 42 | ::testing::InitGoogleTest(&argc, argv); 43 | static_cast(::testing::AddGlobalTestEnvironment(testEnv)); 44 | return RUN_ALL_TESTS(); 45 | } 46 | -------------------------------------------------------------------------------- /tests/array/array/testArray2fIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array2fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array2fTestIters 6 | 7 | #include "utils/gtest2fTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray2ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray2fPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array2fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array2fTestPtrs 6 | 7 | #include "utils/gtest2fTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | #include "testArray2PtrsBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray2fRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array2fTestRefs 10 | 11 | #include "utils/gtest2fTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray2RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray2fViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array2fTestViewIters 10 | 11 | #include "utils/gtest2fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array2f 14 | #define SCALAR float 15 | #define DIMS 2 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray2fViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array2fTestViewPtrs 10 | 11 | #include "utils/gtest2fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array2f 14 | #define SCALAR float 15 | #define DIMS 2 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray2fViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array2.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array2fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array2fTestViews 10 | 11 | #include "utils/gtest2fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array2f 14 | #define SCALAR float 15 | #define DIMS 2 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray2ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/array/testArray3dIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array3dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array3dTestIters 6 | 7 | #include "utils/gtest3dTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray3ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray3dPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array3dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array3dTestPtrs 6 | 7 | #include "utils/gtest3dTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | #include "testArray3PtrsBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray3dRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array3dTestRefs 10 | 11 | #include "utils/gtest3dTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray3RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray3dViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array3dTestViewIters 10 | 11 | #include "utils/gtest3dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array3d 14 | #define SCALAR double 15 | #define DIMS 3 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray3dViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array3dTestViewPtrs 10 | 11 | #include "utils/gtest3dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array3d 14 | #define SCALAR double 15 | #define DIMS 3 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray3dViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array3dTestViews 10 | 11 | #include "utils/gtest3dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array3d 14 | #define SCALAR double 15 | #define DIMS 3 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray3ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/array/testArray3f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array1.hpp" 2 | #include "zfp/array2.hpp" 3 | #include "zfp/array3.hpp" 4 | #include "zfp/factory.hpp" 5 | #include "zfp/array4.hpp" 6 | using namespace zfp; 7 | 8 | extern "C" { 9 | #include "constants/3dFloat.h" 10 | } 11 | 12 | #include "gtest/gtest.h" 13 | #include "utils/gtestFloatEnv.h" 14 | #include "utils/gtestBaseFixture.h" 15 | #include "utils/predicates.h" 16 | 17 | class Array3fTestEnv : public ArrayFloatTestEnv { 18 | public: 19 | virtual int getDims() { return 3; } 20 | }; 21 | 22 | Array3fTestEnv* const testEnv = new Array3fTestEnv; 23 | 24 | class Array3fTest : public ArrayNdTestFixture {}; 25 | 26 | #define TEST_FIXTURE Array3fTest 27 | 28 | #define ZFP_ARRAY_TYPE array3f 29 | #define ZFP_ARRAY_TYPE_WRONG_SCALAR array3d 30 | #define ZFP_ARRAY_TYPE_WRONG_DIM array4f 31 | #define ZFP_ARRAY_TYPE_WRONG_SCALAR_DIM array4d 32 | #define ZFP_ARRAY_NOT_INCLUDED_TYPE array2f 33 | 34 | #define UINT uint32 35 | #define SCALAR float 36 | #define DIMS 3 37 | 38 | #include "testArrayBase.cpp" 39 | #include "testArray3Base.cpp" 40 | 41 | int main(int argc, char* argv[]) { 42 | ::testing::InitGoogleTest(&argc, argv); 43 | static_cast(::testing::AddGlobalTestEnvironment(testEnv)); 44 | return RUN_ALL_TESTS(); 45 | } 46 | -------------------------------------------------------------------------------- /tests/array/array/testArray3fIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array3fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array3fTestIters 6 | 7 | #include "utils/gtest3fTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray3ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray3fPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array3fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array3fTestPtrs 6 | 7 | #include "utils/gtest3fTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | #include "testArray3PtrsBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray3fRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array3fTestRefs 10 | 11 | #include "utils/gtest3fTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray3RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray3fViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array3fTestViewIters 10 | 11 | #include "utils/gtest3fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array3f 14 | #define SCALAR float 15 | #define DIMS 3 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray3fViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array3fTestViewPtrs 10 | 11 | #include "utils/gtest3fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array3f 14 | #define SCALAR float 15 | #define DIMS 3 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray3fViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array3fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array3fTestViews 10 | 11 | #include "utils/gtest3fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array3f 14 | #define SCALAR float 15 | #define DIMS 3 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray3ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/array/testArray4dIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array4dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array4dTestIters 6 | 7 | #include "utils/gtest4dTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray4ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray4dPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array4dTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array4dTestPtrs 6 | 7 | #include "utils/gtest4dTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | #include "testArray4PtrsBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray4dRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array4dTestRefs 10 | 11 | #include "utils/gtest4dTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray4RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray4dViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array4dTestViewIters 10 | 11 | #include "utils/gtest4dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array4d 14 | #define SCALAR double 15 | #define DIMS 4 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray4dViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array4dTestViewPtrs 10 | 11 | #include "utils/gtest4dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array4d 14 | #define SCALAR double 15 | #define DIMS 4 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray4dViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4dTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array4dTestViews 10 | 11 | #include "utils/gtest4dTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array4d 14 | #define SCALAR double 15 | #define DIMS 4 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray4ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/array/testArray4fIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array4fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_ITERS Array4fTestIters 6 | 7 | #include "utils/gtest4fTest.h" 8 | 9 | #include "testArrayItersBase.cpp" 10 | #include "testArray4ItersBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray4fPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | #define ARRAY_DIMS_SCALAR_TEST Array4fTest 5 | #define ARRAY_DIMS_SCALAR_TEST_PTRS Array4fTestPtrs 6 | 7 | #include "utils/gtest4fTest.h" 8 | 9 | #include "testArrayPtrsBase.cpp" 10 | #include "testArray4PtrsBase.cpp" 11 | -------------------------------------------------------------------------------- /tests/array/array/testArray4fRefs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_REFS Array4fTestRefs 10 | 11 | #include "utils/gtest4fTest.h" 12 | 13 | #include "testArrayRefsBase.cpp" 14 | #include "testArray4RefsBase.cpp" 15 | -------------------------------------------------------------------------------- /tests/array/array/testArray4fViewIters.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_ITERS Array4fTestViewIters 10 | 11 | #include "utils/gtest4fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array4f 14 | #define SCALAR float 15 | #define DIMS 4 16 | 17 | #include "testArrayViewItersBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray4fViewPtrs.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand64.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEW_PTRS Array4fTestViewPtrs 10 | 11 | #include "utils/gtest4fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array4f 14 | #define SCALAR float 15 | #define DIMS 4 16 | 17 | #include "testArrayViewPtrsBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/array/testArray4fViews.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array4.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "utils/rand32.h" 6 | } 7 | 8 | #define ARRAY_DIMS_SCALAR_TEST Array4fTest 9 | #define ARRAY_DIMS_SCALAR_TEST_VIEWS Array4fTestViews 10 | 11 | #include "utils/gtest4fTest.h" 12 | 13 | #define ZFP_ARRAY_TYPE array4f 14 | #define SCALAR float 15 | #define DIMS 4 16 | 17 | #include "testArrayViewsBase.cpp" 18 | #include "testArray4ViewsBase.cpp" 19 | -------------------------------------------------------------------------------- /tests/array/constArray/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(zfp_add_cpp_tests dims type bits) 2 | 3 | # test compressed const array class 4 | set(test_name testConstArray${dims}${type}) 5 | add_executable(${test_name} ${test_name}.cpp) 6 | target_link_libraries(${test_name} 7 | gtest gtest_main zfp zfpHashLib genSmoothRandNumsLib zfpChecksumsLib) 8 | target_compile_definitions(${test_name} PRIVATE ${zfp_compressed_array_defs}) 9 | add_test(NAME ${test_name} COMMAND ${test_name}) 10 | 11 | endfunction() 12 | 13 | zfp_add_cpp_tests(1 f 32) 14 | zfp_add_cpp_tests(2 f 32) 15 | zfp_add_cpp_tests(3 f 32) 16 | zfp_add_cpp_tests(4 f 32) 17 | zfp_add_cpp_tests(1 d 64) 18 | zfp_add_cpp_tests(2 d 64) 19 | zfp_add_cpp_tests(3 d 64) 20 | zfp_add_cpp_tests(4 d 64) 21 | -------------------------------------------------------------------------------- /tests/array/constArray/testConstArray1Base.cpp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/array/constArray/testConstArray2Base.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/zfp/7d1e3a21047a976599b562b3bbd53b1f34348f1a/tests/array/constArray/testConstArray2Base.cpp -------------------------------------------------------------------------------- /tests/array/constArray/testConstArray3Base.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/zfp/7d1e3a21047a976599b562b3bbd53b1f34348f1a/tests/array/constArray/testConstArray3Base.cpp -------------------------------------------------------------------------------- /tests/array/constArray/testConstArray4Base.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/zfp/7d1e3a21047a976599b562b3bbd53b1f34348f1a/tests/array/constArray/testConstArray4Base.cpp -------------------------------------------------------------------------------- /tests/array/decode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(zfp_add_cpp_tests dims type bits) 2 | # test templated block encoding 3 | set(test_name testTemplatedDecode${dims}${type}) 4 | add_executable(${test_name} ${test_name}.cpp) 5 | target_link_libraries(${test_name} 6 | gtest gtest_main zfp rand${bits}Lib) 7 | target_compile_definitions(${test_name} PRIVATE ${zfp_compressed_array_defs}) 8 | add_test(NAME ${test_name} COMMAND ${test_name}) 9 | 10 | endfunction() 11 | 12 | zfp_add_cpp_tests(1 f 32) 13 | zfp_add_cpp_tests(2 f 32) 14 | zfp_add_cpp_tests(3 f 32) 15 | zfp_add_cpp_tests(4 f 32) 16 | zfp_add_cpp_tests(1 d 64) 17 | zfp_add_cpp_tests(2 d 64) 18 | zfp_add_cpp_tests(3 d 64) 19 | zfp_add_cpp_tests(4 d 64) 20 | 21 | #zfp_add_cpp_tests(1 Int32 32) 22 | #zfp_add_cpp_tests(2 Int32 32) 23 | #zfp_add_cpp_tests(3 Int32 32) 24 | #zfp_add_cpp_tests(4 Int32 32) 25 | #zfp_add_cpp_tests(1 Int64 64) 26 | #zfp_add_cpp_tests(2 Int64 64) 27 | #zfp_add_cpp_tests(3 Int64 64) 28 | #zfp_add_cpp_tests(4 Int64 64) 29 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode1d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/1dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_1d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_1 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_double_1 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_1 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_double_1 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_1 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_double_1 16 | 17 | #define SCALAR double 18 | #define DIMS 1 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode1f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/1dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_1d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_1 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_float_1 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_1 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_float_1 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_1 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_float_1 16 | 17 | #define SCALAR float 18 | #define DIMS 1 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode2d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/2dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_2d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_2 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_double_2 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_2 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_double_2 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_2 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_double_2 16 | 17 | #define SCALAR double 18 | #define DIMS 2 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode2f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/2dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_2d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_2 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_float_2 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_2 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_float_2 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_2 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_float_2 16 | 17 | #define SCALAR float 18 | #define DIMS 2 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode3d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/3dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_3d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_3 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_double_3 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_3 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_double_3 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_3 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_double_3 16 | 17 | #define SCALAR double 18 | #define DIMS 3 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode3f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/3dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_3d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_3 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_float_3 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_3 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_float_3 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_3 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_float_3 16 | 17 | #define SCALAR float 18 | #define DIMS 3 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode4d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/4dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_4d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_4 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_double_4 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_4 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_double_4 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_4 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_double_4 16 | 17 | #define SCALAR double 18 | #define DIMS 4 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/decode/testTemplatedDecode4f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/4dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_4d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_4 11 | #define ZFP_DECODE_BLOCK_FUNC zfp_decode_block_float_4 12 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_4 13 | #define ZFP_DECODE_BLOCK_STRIDED_FUNC zfp_decode_block_strided_float_4 14 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_4 15 | #define ZFP_DECODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_decode_partial_block_strided_float_4 16 | 17 | #define SCALAR float 18 | #define DIMS 4 19 | 20 | #include "testTemplatedDecodeBase.cpp" 21 | -------------------------------------------------------------------------------- /tests/array/encode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(zfp_add_cpp_tests dims type bits) 2 | 3 | # test templated block encoding 4 | set(test_name testTemplatedEncode${dims}${type}) 5 | add_executable(${test_name} ${test_name}.cpp) 6 | target_link_libraries(${test_name} 7 | gtest gtest_main zfp rand${bits}Lib) 8 | target_compile_definitions(${test_name} PRIVATE ${zfp_compressed_array_defs}) 9 | add_test(NAME ${test_name} COMMAND ${test_name}) 10 | 11 | endfunction() 12 | 13 | zfp_add_cpp_tests(1 f 32) 14 | zfp_add_cpp_tests(2 f 32) 15 | zfp_add_cpp_tests(3 f 32) 16 | zfp_add_cpp_tests(4 f 32) 17 | zfp_add_cpp_tests(1 d 64) 18 | zfp_add_cpp_tests(2 d 64) 19 | zfp_add_cpp_tests(3 d 64) 20 | zfp_add_cpp_tests(4 d 64) 21 | 22 | #zfp_add_cpp_tests(1 Int32 32) 23 | #zfp_add_cpp_tests(2 Int32 32) 24 | #zfp_add_cpp_tests(3 Int32 32) 25 | #zfp_add_cpp_tests(4 Int32 32) 26 | #zfp_add_cpp_tests(1 Int64 64) 27 | #zfp_add_cpp_tests(2 Int64 64) 28 | #zfp_add_cpp_tests(3 Int64 64) 29 | #zfp_add_cpp_tests(4 Int64 64) 30 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode1d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/1dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_1d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_1 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_1 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_1 13 | 14 | #define SCALAR double 15 | #define DIMS 1 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode1f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/1dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_1d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_1 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_1 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_1 13 | 14 | #define SCALAR float 15 | #define DIMS 1 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode2d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/2dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_2d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_2 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_2 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_2 13 | 14 | #define SCALAR double 15 | #define DIMS 2 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode2f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/2dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_2d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_2 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_2 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_2 13 | 14 | #define SCALAR float 15 | #define DIMS 2 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode3d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/3dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_3d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_3 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_3 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_3 13 | 14 | #define SCALAR double 15 | #define DIMS 3 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode3f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/3dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_3d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_3 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_3 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_3 13 | 14 | #define SCALAR float 15 | #define DIMS 3 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode4d.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/4dDouble.h" 6 | #include "utils/rand64.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_4d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_double_4 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_double_4 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_double_4 13 | 14 | #define SCALAR double 15 | #define DIMS 4 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/encode/testTemplatedEncode4f.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp.hpp" 2 | using namespace zfp; 3 | 4 | extern "C" { 5 | #include "constants/4dFloat.h" 6 | #include "utils/rand32.h" 7 | } 8 | 9 | #define ZFP_FIELD_FUNC zfp_field_4d 10 | #define ZFP_ENCODE_BLOCK_FUNC zfp_encode_block_float_4 11 | #define ZFP_ENCODE_BLOCK_STRIDED_FUNC zfp_encode_block_strided_float_4 12 | #define ZFP_ENCODE_PARTIAL_BLOCK_STRIDED_FUNC zfp_encode_partial_block_strided_float_4 13 | 14 | #define SCALAR float 15 | #define DIMS 4 16 | 17 | #include "testTemplatedEncodeBase.cpp" 18 | -------------------------------------------------------------------------------- /tests/array/utils/commonMacros.h: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #define DIV_ROUND_UP(x, y) (((x) + (y) - 1) / (y)) 4 | #define BITS_TO_BYTES(x) DIV_ROUND_UP(x, CHAR_BIT) 5 | 6 | #define ZFP_HEADER_SIZE_BITS (ZFP_MAGIC_BITS + ZFP_META_BITS + ZFP_MODE_SHORT_BITS) 7 | -------------------------------------------------------------------------------- /tests/array/utils/gtestCApiTest.h: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "commonMacros.h" 3 | 4 | class ZfpArrayConstructTest : public ::testing::Test { 5 | protected: 6 | virtual void SetUp() { 7 | size_t num_64bit_entries = DIV_ROUND_UP(ZFP_HEADER_SIZE_BITS, CHAR_BIT * sizeof(uint64)); 8 | buffer = new uint64[num_64bit_entries]; 9 | 10 | bs = stream_open(buffer, num_64bit_entries * sizeof(uint64)); 11 | stream = zfp_stream_open(bs); 12 | field = zfp_field_alloc(); 13 | } 14 | 15 | virtual void TearDown() { 16 | zfp_field_free(field); 17 | zfp_stream_close(stream); 18 | stream_close(bs); 19 | delete[] buffer; 20 | } 21 | 22 | static uint64* buffer; 23 | static bitstream* bs; 24 | static zfp_stream* stream; 25 | static zfp_field* field; 26 | }; 27 | 28 | uint64* ZfpArrayConstructTest::buffer; 29 | bitstream* ZfpArrayConstructTest::bs; 30 | zfp_stream* ZfpArrayConstructTest::stream; 31 | zfp_field* ZfpArrayConstructTest::field; 32 | -------------------------------------------------------------------------------- /tests/array/utils/gtestSingleFixture.h: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | class TestFixture : public ::testing::TestWithParam { 4 | protected: 5 | virtual void SetUp() {} 6 | }; 7 | -------------------------------------------------------------------------------- /tests/array/utils/gtestTestEnv.h: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | class TestEnv : public ::testing::Environment { 4 | public: 5 | virtual void SetUp() {} 6 | 7 | virtual void TearDown() {} 8 | }; 9 | -------------------------------------------------------------------------------- /tests/array/zfp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(ZFP_WITH_ALIGNED_ALLOC) 2 | add_executable(testAlignedMemory testAlignedMemory.cpp) 3 | target_link_libraries(testAlignedMemory gtest gtest_main zfp) 4 | target_compile_definitions(testAlignedMemory PRIVATE ${zfp_compressed_array_defs}) 5 | add_test(NAME testAlignedMemory COMMAND testAlignedMemory) 6 | endif() 7 | -------------------------------------------------------------------------------- /tests/array/zfp/testAlignedMemory.cpp: -------------------------------------------------------------------------------- 1 | #include "zfp/array3.hpp" 2 | using namespace zfp; 3 | 4 | #include "gtest/gtest.h" 5 | #include "../utils/gtestTestEnv.h" 6 | #include "../utils/gtestSingleFixture.h" 7 | #include "../utils/predicates.h" 8 | 9 | #include 10 | 11 | TestEnv* const testEnv = new TestEnv; 12 | 13 | class AlignedMemoryTest : public TestFixture {}; 14 | 15 | #define TEST_FIXTURE AlignedMemoryTest 16 | 17 | INSTANTIATE_TEST_SUITE_P(TestManyMemoryAlignments, TEST_FIXTURE, ::testing::Range(4, 11)); 18 | 19 | TEST_P(TEST_FIXTURE, when_allocateAlignedMem_expect_addressAligned) 20 | { 21 | size_t alignmentBytes = (size_t)(1u << GetParam()); 22 | void* ptr = allocate_aligned(30, alignmentBytes); 23 | 24 | uintptr_t address = (uintptr_t)ptr; 25 | EXPECT_EQ(address % alignmentBytes, 0); 26 | 27 | deallocate_aligned(ptr); 28 | } 29 | 30 | int main(int argc, char* argv[]) { 31 | ::testing::InitGoogleTest(&argc, argv); 32 | static_cast(::testing::AddGlobalTestEnvironment(testEnv)); 33 | return RUN_ALL_TESTS(); 34 | } 35 | -------------------------------------------------------------------------------- /tests/cfp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(cfp_add_test dims type bits) 2 | set(test_name testCfpArray${dims}${type}) 3 | add_executable(${test_name} ${test_name}.c) 4 | target_link_libraries(${test_name} 5 | cmocka cfp zfpHashLib genSmoothRandNumsLib zfpChecksumsLib) 6 | add_test(NAME ${test_name} COMMAND ${test_name}) 7 | endfunction() 8 | 9 | cfp_add_test(1 f 32) 10 | cfp_add_test(2 f 32) 11 | cfp_add_test(3 f 32) 12 | cfp_add_test(4 f 32) 13 | cfp_add_test(1 d 64) 14 | cfp_add_test(2 d 64) 15 | cfp_add_test(3 d 64) 16 | cfp_add_test(4 d 64) 17 | 18 | if(DEFINED CFP_NAMESPACE) 19 | add_executable(testCfpNamespace testCfpNamespace.c) 20 | target_link_libraries(testCfpNamespace cmocka cfp) 21 | add_test(NAME testCfpNamespace COMMAND testCfpNamespace) 22 | endif() 23 | -------------------------------------------------------------------------------- /tests/cfp/testCfpNamespace.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "zfp/array.h" 7 | 8 | /* only run this test when compiling with CFP_NAMESPACE=cfp2 */ 9 | 10 | /* test fails if compiler errors out */ 11 | static void 12 | given_cfpCompiledWithNamespace_cfp2_when_linkToCfpLib_expect_namespacePersists(void** state) 13 | { 14 | cfp_array1d arr = cfp2.array1d.ctor_default(); 15 | assert_non_null(arr.object); 16 | 17 | cfp2.array1d.dtor(arr); 18 | } 19 | 20 | int main() 21 | { 22 | const struct CMUnitTest tests[] = { 23 | cmocka_unit_test(given_cfpCompiledWithNamespace_cfp2_when_linkToCfpLib_expect_namespacePersists), 24 | }; 25 | 26 | return cmocka_run_group_tests(tests, NULL, NULL); 27 | } 28 | -------------------------------------------------------------------------------- /tests/ci-utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This empty project is used to determine if OpenMP is available on CI machines 2 | # without compiling any ZFP code. 3 | 4 | cmake_minimum_required(VERSION 3.9) 5 | 6 | find_package(OpenMP COMPONENTS C REQUIRED) 7 | -------------------------------------------------------------------------------- /tests/constants/1dDouble.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "doubleConsts.h" 3 | 4 | #define DIM_INT_STR 1dDouble 5 | -------------------------------------------------------------------------------- /tests/constants/1dFloat.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "floatConsts.h" 3 | 4 | #define DIM_INT_STR 1dFloat 5 | -------------------------------------------------------------------------------- /tests/constants/1dInt32.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int32Consts.h" 3 | 4 | #define DIM_INT_STR 1dInt32 5 | -------------------------------------------------------------------------------- /tests/constants/1dInt64.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int64Consts.h" 3 | 4 | #define DIM_INT_STR 1dInt64 5 | -------------------------------------------------------------------------------- /tests/constants/2dDouble.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "doubleConsts.h" 3 | 4 | #define DIM_INT_STR 2dDouble 5 | -------------------------------------------------------------------------------- /tests/constants/2dFloat.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "floatConsts.h" 3 | 4 | #define DIM_INT_STR 2dFloat 5 | -------------------------------------------------------------------------------- /tests/constants/2dInt32.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int32Consts.h" 3 | 4 | #define DIM_INT_STR 2dInt32 5 | -------------------------------------------------------------------------------- /tests/constants/2dInt64.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int64Consts.h" 3 | 4 | #define DIM_INT_STR 2dInt64 5 | -------------------------------------------------------------------------------- /tests/constants/3dDouble.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "doubleConsts.h" 3 | 4 | #define DIM_INT_STR 3dDouble 5 | -------------------------------------------------------------------------------- /tests/constants/3dFloat.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "floatConsts.h" 3 | 4 | #define DIM_INT_STR 3dFloat 5 | -------------------------------------------------------------------------------- /tests/constants/3dInt32.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int32Consts.h" 3 | 4 | #define DIM_INT_STR 3dInt32 5 | -------------------------------------------------------------------------------- /tests/constants/3dInt64.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int64Consts.h" 3 | 4 | #define DIM_INT_STR 3dInt64 5 | -------------------------------------------------------------------------------- /tests/constants/4dDouble.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "doubleConsts.h" 3 | 4 | #define DIM_INT_STR 4dDouble 5 | -------------------------------------------------------------------------------- /tests/constants/4dFloat.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "floatConsts.h" 3 | 4 | #define DIM_INT_STR 4dFloat 5 | -------------------------------------------------------------------------------- /tests/constants/4dInt32.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int32Consts.h" 3 | 4 | #define DIM_INT_STR 4dInt32 5 | -------------------------------------------------------------------------------- /tests/constants/4dInt64.h: -------------------------------------------------------------------------------- 1 | #include "universalConsts.h" 2 | #include "int64Consts.h" 3 | 4 | #define DIM_INT_STR 4dInt64 5 | -------------------------------------------------------------------------------- /tests/constants/checksums/1dInt32.h: -------------------------------------------------------------------------------- 1 | static const checksum_tuples _1dInt32Checksums[19] = { 2 | {UINT64C(0x0), UINT64C(0x3), UINT64C(0xf3e7c054)}, 3 | {UINT64C(0xa0), UINT64C(0x3), UINT64C(0xc9d92bd5bdfd2c41)}, 4 | {UINT64C(0x2a0), UINT64C(0x3), UINT64C(0x2b7ac04c5f2c27f9)}, 5 | {UINT64C(0x120), UINT64C(0x3), UINT64C(0x4b38a824)}, 6 | {UINT64C(0x320), UINT64C(0x3), UINT64C(0xfbfb6da8)}, 7 | {UINT64C(0x400), UINT64C(0x1000), UINT64C(0x224cbf63)}, 8 | {UINT64C(0x4b0), UINT64C(0x1000), UINT64C(0xd31e1d4f3028cea)}, 9 | {UINT64C(0x530), UINT64C(0x1000), UINT64C(0xae502d39)}, 10 | {UINT64C(0x4b1), UINT64C(0x1000), UINT64C(0x2d76d29099fb22ec)}, 11 | {UINT64C(0x531), UINT64C(0x1000), UINT64C(0xdf369702)}, 12 | {UINT64C(0x4b2), UINT64C(0x1000), UINT64C(0xb90d9da736a534a9)}, 13 | {UINT64C(0x532), UINT64C(0x1000), UINT64C(0x8e2310b0)}, 14 | {UINT64C(0x4a0), UINT64C(0x1000), UINT64C(0x804c71c729a559cf)}, 15 | {UINT64C(0x520), UINT64C(0x1000), UINT64C(0xff2890c)}, 16 | {UINT64C(0x4a1), UINT64C(0x1000), UINT64C(0xbe1ef33c903369a4)}, 17 | {UINT64C(0x521), UINT64C(0x1000), UINT64C(0x35a6f08e)}, 18 | {UINT64C(0x4a2), UINT64C(0x1000), UINT64C(0x8c1e4b2bdfca4bca)}, 19 | {UINT64C(0x522), UINT64C(0x1000), UINT64C(0x8e2310b0)}, 20 | {UINT64C(0x4d0), UINT64C(0x1000), UINT64C(0xcd449c2be8c8a337)}, 21 | }; 22 | -------------------------------------------------------------------------------- /tests/constants/doubleConsts.h: -------------------------------------------------------------------------------- 1 | #define FL_PT_DATA 2 | #define SCALAR_BITS 64 3 | #define ZFP_TYPE zfp_type_double 4 | -------------------------------------------------------------------------------- /tests/constants/floatConsts.h: -------------------------------------------------------------------------------- 1 | #define FL_PT_DATA 2 | #define SCALAR_BITS 32 3 | #define ZFP_TYPE zfp_type_float 4 | -------------------------------------------------------------------------------- /tests/constants/int32Consts.h: -------------------------------------------------------------------------------- 1 | #define SCALAR_BITS 32 2 | #define ZFP_TYPE zfp_type_int32 3 | -------------------------------------------------------------------------------- /tests/constants/int64Consts.h: -------------------------------------------------------------------------------- 1 | #define SCALAR_BITS 64 2 | #define ZFP_TYPE zfp_type_int64 3 | -------------------------------------------------------------------------------- /tests/constants/universalConsts.h: -------------------------------------------------------------------------------- 1 | #define BLOCK_SIDE_LEN 4 2 | 3 | #define ZFP_RATE_PARAM_BITS 19 4 | #define ZFP_PREC_PARAM_BITS 22 5 | -------------------------------------------------------------------------------- /tests/fortran/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_language(Fortran) 2 | 3 | if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") 4 | set(dialect "-ffree-form -std=f2008 -fimplicit-none") 5 | set(bounds "-fbounds-check") 6 | endif() 7 | if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") 8 | set(dialect "-stand f08 -free -implicitnone") 9 | set(bounds "-check bounds") 10 | endif() 11 | 12 | set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/modules) 13 | set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${bounds}") 14 | set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialect}") 15 | 16 | add_executable(testFortran testFortran.f) 17 | target_link_libraries(testFortran zFORp) 18 | add_test(NAME testFortran COMMAND testFortran) 19 | -------------------------------------------------------------------------------- /tests/gitlab/corona-jobs.yml: -------------------------------------------------------------------------------- 1 | ########### 2 | # HIP GPU # 3 | ########### 4 | 5 | rocm-3.10.0_build: 6 | variables: 7 | ci_cmake: "cmake/3.21.1" 8 | ci_cmp_mod: "rocm/3.10.0" 9 | ci_cmp_path: "/opt/rocm-3.10.0/hip" 10 | extends: [.hip, .corona_build_gpu] 11 | needs: [] 12 | 13 | rocm-3.10.0_test: 14 | variables: 15 | ci_test_regex: "Hip" 16 | extends: [.corona_test_gpu] 17 | needs: [rocm-3.10.0_build] 18 | -------------------------------------------------------------------------------- /tests/gitlab/corona-templates.yml: -------------------------------------------------------------------------------- 1 | .corona_job: 2 | tags: 3 | - batch 4 | - corona 5 | 6 | .corona_build_gpu: 7 | extends: [.build_gpu, .corona_job] 8 | 9 | .corona_test_gpu: 10 | variables: 11 | ci_test_regex: "." 12 | extends: [.test_gpu, .corona_job] 13 | -------------------------------------------------------------------------------- /tests/gitlab/dane-templates.yml: -------------------------------------------------------------------------------- 1 | .dane_job: 2 | tags: 3 | - batch 4 | - dane 5 | 6 | .dane_build_cpu: 7 | extends: [.build_cpu, .dane_job] 8 | 9 | .dane_test_cpu: 10 | variables: 11 | ci_test_regex: "." 12 | extends: [.test_cpu, .dane_job] 13 | -------------------------------------------------------------------------------- /tests/gitlab/lassen-jobs.yml: -------------------------------------------------------------------------------- 1 | ############ 2 | # CUDA GPU # 3 | ############ 4 | 5 | cuda-11.6.1_build: 6 | variables: 7 | ci_cmake: "cmake/3.14.5" 8 | ci_cmp_mod: "cuda/11.6.1" 9 | ci_gcc_mod: "gcc/8.3.1" 10 | extends: [.cuda, .lassen_build_gpu] 11 | needs: [] 12 | 13 | cuda-11.6.1_test: 14 | variables: 15 | ci_test_regex: "Cuda" 16 | extends: [.lassen_test_gpu] 17 | needs: [cuda-11.6.1_build] 18 | -------------------------------------------------------------------------------- /tests/gitlab/lassen-templates.yml: -------------------------------------------------------------------------------- 1 | .lassen_job: 2 | tags: 3 | - batch 4 | - lassen 5 | 6 | .lassen_build_gpu: 7 | extends: [.build_gpu, .lassen_job] 8 | 9 | .lassen_test_gpu: 10 | variables: 11 | ci_test_regex: "." 12 | extends: [.test_gpu, .lassen_job] 13 | -------------------------------------------------------------------------------- /tests/gitlab/pascal-jobs.yml: -------------------------------------------------------------------------------- 1 | ############ 2 | # CUDA GPU # 3 | ############ 4 | 5 | cuda-11.8.0_build: 6 | variables: 7 | ci_cmake: "cmake/3.14.5" 8 | ci_cmp_mod: "cuda/11.8.0" 9 | ci_gcc_mod: "gcc/10.3.1" 10 | extends: [.cuda, .pascal_build_gpu] 11 | needs: [] 12 | 13 | cuda-11.8.0_test: 14 | variables: 15 | ci_test_regex: "Cuda" 16 | extends: [.pascal_test_gpu] 17 | needs: [cuda-11.8.0_build] 18 | -------------------------------------------------------------------------------- /tests/gitlab/pascal-templates.yml: -------------------------------------------------------------------------------- 1 | .pascal_job: 2 | tags: 3 | - batch 4 | - pascal 5 | 6 | .pascal_build_gpu: 7 | extends: [.build_gpu, .pascal_job] 8 | 9 | .pascal_test_gpu: 10 | variables: 11 | ci_test_regex: "." 12 | extends: [.test_gpu, .pascal_job] 13 | -------------------------------------------------------------------------------- /tests/gitlab/quartz-templates.yml: -------------------------------------------------------------------------------- 1 | .quartz_job: 2 | tags: 3 | - batch 4 | - quartz 5 | 6 | .quartz_build_cpu: 7 | extends: [.build_cpu, .quartz_job] 8 | 9 | .quartz_test_cpu: 10 | variables: 11 | ci_test_regex: "." 12 | extends: [.test_cpu, .quartz_job] 13 | -------------------------------------------------------------------------------- /tests/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # compile tests 2 | if(NOT DEFINED ZFP_OMP_TESTS_ONLY) 3 | add_subdirectory(inline) 4 | add_subdirectory(misc) 5 | add_subdirectory(encode) 6 | add_subdirectory(decode) 7 | endif() 8 | 9 | add_subdirectory(endtoend) 10 | add_subdirectory(execPolicy) 11 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock1dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1d.c" 2 | 3 | #include "constants/1dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock1dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1f.c" 2 | 3 | #include "constants/1dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock1dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1i.c" 2 | 3 | #include "constants/1dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock1dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1l.c" 2 | 3 | #include "constants/1dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock2dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2d.c" 2 | 3 | #include "constants/2dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock2dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2f.c" 2 | 3 | #include "constants/2dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock2dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2i.c" 2 | 3 | #include "constants/2dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock2dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2l.c" 2 | 3 | #include "constants/2dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock3dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3d.c" 2 | 3 | #include "constants/3dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock3dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3f.c" 2 | 3 | #include "constants/3dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock3dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3i.c" 2 | 3 | #include "constants/3dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock3dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3l.c" 2 | 3 | #include "constants/3dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock4dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4d.c" 2 | 3 | #include "constants/4dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock4dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4f.c" 2 | 3 | #include "constants/4dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock4dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4i.c" 2 | 3 | #include "constants/4dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlock4dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4l.c" 2 | 3 | #include "constants/4dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided1dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1d.c" 2 | 3 | #include "constants/1dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided1dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1f.c" 2 | 3 | #include "constants/1dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided1dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1i.c" 2 | 3 | #include "constants/1dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided1dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode1l.c" 2 | 3 | #include "constants/1dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided2dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2d.c" 2 | 3 | #include "constants/2dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided2dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2f.c" 2 | 3 | #include "constants/2dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided2dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2i.c" 2 | 3 | #include "constants/2dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided2dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode2l.c" 2 | 3 | #include "constants/2dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided3dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3d.c" 2 | 3 | #include "constants/3dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided3dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3f.c" 2 | 3 | #include "constants/3dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided3dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3i.c" 2 | 3 | #include "constants/3dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided3dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode3l.c" 2 | 3 | #include "constants/3dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided4dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4d.c" 2 | 3 | #include "constants/4dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided4dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4f.c" 2 | 3 | #include "constants/4dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided4dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4i.c" 2 | 3 | #include "constants/4dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testZfpDecodeBlockStrided4dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/decode4l.c" 2 | 3 | #include "constants/4dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpDecodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/decode/testcases/block.c: -------------------------------------------------------------------------------- 1 | // requires #include "utils/testMacros.h", do outside of main() 2 | 3 | #ifndef PRINT_CHECKSUMS 4 | _cmocka_unit_test_setup_teardown(when_seededRandomDataGenerated_expect_ChecksumMatches, setup, teardown), 5 | #endif 6 | 7 | _cmocka_unit_test_setup_teardown(_catFunc3(given_, DIM_INT_STR, Block_when_DecodeBlock_expect_ReturnValReflectsNumBitsReadFromBitstream), setup, teardown), 8 | _cmocka_unit_test_setup_teardown(_catFunc3(given_, DIM_INT_STR, Block_when_DecodeBlock_expect_ArrayChecksumMatches), setup, teardown), 9 | 10 | #ifdef FL_PT_DATA 11 | // reversible compression and decompression of blocks containing special floating-point values 12 | _cmocka_unit_test_setup_teardown(_catFunc3(given_, DIM_INT_STR, Block_when_DecodeSpecialBlocks_expect_ArraysMatchBitForBit), setupSpecial, teardown), 13 | #endif 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock1dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1d.c" 2 | 3 | #include "constants/1dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock1dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1f.c" 2 | 3 | #include "constants/1dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock1dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1i.c" 2 | 3 | #include "constants/1dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock1dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1l.c" 2 | 3 | #include "constants/1dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock2dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2d.c" 2 | 3 | #include "constants/2dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock2dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2f.c" 2 | 3 | #include "constants/2dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock2dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2i.c" 2 | 3 | #include "constants/2dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock2dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2l.c" 2 | 3 | #include "constants/2dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock3dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3d.c" 2 | 3 | #include "constants/3dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock3dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3f.c" 2 | 3 | #include "constants/3dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock3dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3i.c" 2 | 3 | #include "constants/3dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock3dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3l.c" 2 | 3 | #include "constants/3dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock4dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4d.c" 2 | 3 | #include "constants/4dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock4dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4f.c" 2 | 3 | #include "constants/4dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock4dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4i.c" 2 | 3 | #include "constants/4dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlock4dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4l.c" 2 | 3 | #include "constants/4dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/block.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided1dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1d.c" 2 | 3 | #include "constants/1dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided1dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1f.c" 2 | 3 | #include "constants/1dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided1dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1i.c" 2 | 3 | #include "constants/1dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided1dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1l.c" 2 | 3 | #include "constants/1dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided2dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2d.c" 2 | 3 | #include "constants/2dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided2dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2f.c" 2 | 3 | #include "constants/2dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided2dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2i.c" 2 | 3 | #include "constants/2dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided2dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2l.c" 2 | 3 | #include "constants/2dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided3dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3d.c" 2 | 3 | #include "constants/3dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided3dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3f.c" 2 | 3 | #include "constants/3dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided3dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3i.c" 2 | 3 | #include "constants/3dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided3dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3l.c" 2 | 3 | #include "constants/3dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided4dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4d.c" 2 | 3 | #include "constants/4dDouble.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided4dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4f.c" 2 | 3 | #include "constants/4dFloat.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided4dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4i.c" 2 | 3 | #include "constants/4dInt32.h" 4 | #include "utils/rand32.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testZfpEncodeBlockStrided4dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4l.c" 2 | 3 | #include "constants/4dInt64.h" 4 | #include "utils/rand64.h" 5 | #include "zfpEncodeBlockStridedBase.c" 6 | 7 | int main() 8 | { 9 | const struct CMUnitTest tests[] = { 10 | #include "testcases/blockStrided.c" 11 | }; 12 | return cmocka_run_group_tests(tests, NULL, NULL); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/encode/testcases/block.c: -------------------------------------------------------------------------------- 1 | // requires #include "utils/testMacros.h", do outside of main() 2 | 3 | _cmocka_unit_test_setup_teardown(when_seededRandomDataGenerated_expect_ChecksumMatches, setup, teardown), 4 | 5 | _cmocka_unit_test_setup_teardown(_catFunc3(given_, DIM_INT_STR, Block_when_EncodeBlock_expect_ReturnValReflectsNumBitsWrittenToBitstream), setup, teardown), 6 | _cmocka_unit_test_setup_teardown(_catFunc3(given_, DIM_INT_STR, Block_when_EncodeBlock_expect_BitstreamChecksumMatches), setup, teardown), 7 | 8 | #ifdef FL_PT_DATA 9 | // reversible compression of blocks containing special floating-point values 10 | _cmocka_unit_test_setup_teardown(_catFunc3(given_, DIM_INT_STR, Block_when_EncodeSpecialBlocks_expect_BitstreamChecksumMatches), setupSpecial, teardown), 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda1dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1d.c" 2 | 3 | #include "constants/1dDouble.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda1dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1f.c" 2 | 3 | #include "constants/1dFloat.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda1dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1i.c" 2 | 3 | #include "constants/1dInt32.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda1dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1l.c" 2 | 3 | #include "constants/1dInt64.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda2dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2d.c" 2 | 3 | #include "constants/2dDouble.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda2dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2f.c" 2 | 3 | #include "constants/2dFloat.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda2dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2i.c" 2 | 3 | #include "constants/2dInt32.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda2dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2l.c" 2 | 3 | #include "constants/2dInt64.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda3dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3d.c" 2 | 3 | #include "constants/3dDouble.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda3dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3f.c" 2 | 3 | #include "constants/3dFloat.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda3dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3i.c" 2 | 3 | #include "constants/3dInt32.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda3dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3l.c" 2 | 3 | #include "constants/3dInt64.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda4dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4d.c" 2 | 3 | #include "constants/4dDouble.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda4dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4f.c" 2 | 3 | #include "constants/4dFloat.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda4dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4i.c" 2 | 3 | #include "constants/4dInt32.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpCuda4dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4l.c" 2 | 3 | #include "constants/4dInt64.h" 4 | #include "cudaExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/cuda.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp1dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1d.c" 2 | 3 | #include "constants/1dDouble.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp1dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1f.c" 2 | 3 | #include "constants/1dFloat.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp1dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1i.c" 2 | 3 | #include "constants/1dInt32.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp1dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1l.c" 2 | 3 | #include "constants/1dInt64.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp2dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2d.c" 2 | 3 | #include "constants/2dDouble.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp2dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2f.c" 2 | 3 | #include "constants/2dFloat.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp2dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2i.c" 2 | 3 | #include "constants/2dInt32.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp2dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2l.c" 2 | 3 | #include "constants/2dInt64.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp3dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3d.c" 2 | 3 | #include "constants/3dDouble.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp3dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3f.c" 2 | 3 | #include "constants/3dFloat.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp3dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3i.c" 2 | 3 | #include "constants/3dInt32.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp3dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3l.c" 2 | 3 | #include "constants/3dInt64.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp4dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4d.c" 2 | 3 | #include "constants/4dDouble.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp4dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4f.c" 2 | 3 | #include "constants/4dFloat.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp4dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4i.c" 2 | 3 | #include "constants/4dInt32.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpOmp4dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4l.c" 2 | 3 | #include "constants/4dInt64.h" 4 | #include "ompExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/omp.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial1dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1d.c" 2 | 3 | #include "constants/1dDouble.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial1dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1f.c" 2 | 3 | #include "constants/1dFloat.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial1dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1i.c" 2 | 3 | #include "constants/1dInt32.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial1dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode1l.c" 2 | 3 | #include "constants/1dInt64.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial2dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2d.c" 2 | 3 | #include "constants/2dDouble.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial2dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2f.c" 2 | 3 | #include "constants/2dFloat.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial2dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2i.c" 2 | 3 | #include "constants/2dInt32.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial2dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode2l.c" 2 | 3 | #include "constants/2dInt64.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial3dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3d.c" 2 | 3 | #include "constants/3dDouble.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial3dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3f.c" 2 | 3 | #include "constants/3dFloat.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial3dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3i.c" 2 | 3 | #include "constants/3dInt32.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial3dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode3l.c" 2 | 3 | #include "constants/3dInt64.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial4dDouble.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4d.c" 2 | 3 | #include "constants/4dDouble.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial4dFloat.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4f.c" 2 | 3 | #include "constants/4dFloat.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial4dInt32.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4i.c" 2 | 3 | #include "constants/4dInt32.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/endtoend/testZfpSerial4dInt64.c: -------------------------------------------------------------------------------- 1 | #include "src/encode4l.c" 2 | 3 | #include "constants/4dInt64.h" 4 | #include "serialExecBase.c" 5 | 6 | int main() 7 | { 8 | const struct CMUnitTest tests[] = { 9 | #include "testcases/serial.c" 10 | }; 11 | 12 | return cmocka_run_group_tests(tests, setupRandomData, teardownRandomData); 13 | } 14 | -------------------------------------------------------------------------------- /tests/src/execPolicy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(testOmp testOmp.c) 2 | target_link_libraries(testOmp cmocka zfp) 3 | add_test(NAME testOmp COMMAND testOmp) 4 | if(ZFP_WITH_OPENMP) 5 | target_link_libraries(testOmp OpenMP::OpenMP_C) 6 | set_property(TEST testOmp PROPERTY RUN_SERIAL TRUE) 7 | endif() 8 | 9 | if(ZFP_WITH_OPENMP) 10 | add_executable(testOmpInternal testOmpInternal.c) 11 | target_link_libraries(testOmpInternal cmocka zfp OpenMP::OpenMP_C) 12 | add_test(NAME testOmpInternal COMMAND testOmpInternal) 13 | endif() 14 | 15 | if(ZFP_WITH_CUDA AND NOT DEFINED ZFP_OMP_TESTS_ONLY) 16 | add_executable(testCuda testCuda.c) 17 | target_link_libraries(testCuda cmocka zfp) 18 | add_test(NAME testCuda COMMAND testCuda) 19 | endif() 20 | -------------------------------------------------------------------------------- /tests/src/inline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(testBitstream testBitstream.c) 2 | target_link_libraries(testBitstream cmocka zfp) 3 | add_test(NAME testBitstream COMMAND testBitstream) 4 | 5 | add_executable(testBitstreamSmallWsize testBitstreamSmallWsize.c) 6 | target_link_libraries(testBitstreamSmallWsize cmocka) 7 | add_test(NAME testBitstreamSmallWsize COMMAND testBitstreamSmallWsize) 8 | 9 | add_executable(testBitstreamStrided testBitstreamStrided.c) 10 | target_link_libraries(testBitstreamStrided cmocka) 11 | add_test(NAME testBitstreamStrided COMMAND testBitstreamStrided) 12 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField1d.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 1 12 | #define ZFP_TYPE zfp_type_double 13 | #define SCALAR double 14 | 15 | #define NX 20 16 | #define SX 2 17 | 18 | #include "zfpFieldBase.c" 19 | 20 | #undef DIMS 21 | #undef ZFP_TYPE 22 | #undef SCALAR 23 | #undef NX 24 | #undef SX 25 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField1f.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 1 12 | #define ZFP_TYPE zfp_type_float 13 | #define SCALAR float 14 | 15 | #define NX 20 16 | #define SX 2 17 | 18 | #include "zfpFieldBase.c" 19 | 20 | #undef DIMS 21 | #undef ZFP_TYPE 22 | #undef SCALAR 23 | #undef NX 24 | #undef SX 25 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField2d.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 2 12 | #define ZFP_TYPE zfp_type_double 13 | #define SCALAR double 14 | 15 | #define NX 20 16 | #define NY 21 17 | #define SX 2 18 | #define SY 3 19 | 20 | #include "zfpFieldBase.c" 21 | 22 | #undef DIMS 23 | #undef ZFP_TYPE 24 | #undef SCALAR 25 | #undef NX 26 | #undef NY 27 | #undef SX 28 | #undef SY 29 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField2f.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 2 12 | #define ZFP_TYPE zfp_type_float 13 | #define SCALAR float 14 | 15 | #define NX 20 16 | #define NY 21 17 | #define SX 2 18 | #define SY 3 19 | 20 | #include "zfpFieldBase.c" 21 | 22 | #undef DIMS 23 | #undef ZFP_TYPE 24 | #undef SCALAR 25 | #undef NX 26 | #undef NY 27 | #undef SX 28 | #undef SY 29 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField3d.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 3 12 | #define ZFP_TYPE zfp_type_double 13 | #define SCALAR double 14 | 15 | #define NX 20 16 | #define NY 21 17 | #define NZ 12 18 | #define SX 2 19 | #define SY 3 20 | #define SZ 4 21 | 22 | #include "zfpFieldBase.c" 23 | 24 | #undef DIMS 25 | #undef ZFP_TYPE 26 | #undef SCALAR 27 | #undef NX 28 | #undef NY 29 | #undef NZ 30 | #undef SX 31 | #undef SY 32 | #undef SZ 33 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField3f.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 3 12 | #define ZFP_TYPE zfp_type_float 13 | #define SCALAR float 14 | 15 | #define NX 20 16 | #define NY 21 17 | #define NZ 12 18 | #define SX 2 19 | #define SY 3 20 | #define SZ 4 21 | 22 | #include "zfpFieldBase.c" 23 | 24 | #undef DIMS 25 | #undef ZFP_TYPE 26 | #undef SCALAR 27 | #undef NX 28 | #undef NY 29 | #undef NZ 30 | #undef SX 31 | #undef SY 32 | #undef SZ 33 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField4d.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 4 12 | #define ZFP_TYPE zfp_type_double 13 | #define SCALAR double 14 | 15 | #define NX 20 16 | #define NY 21 17 | #define NZ 12 18 | #define NW 6 19 | #define SX 2 20 | #define SY 3 21 | #define SZ 4 22 | #define SW 2 23 | 24 | #include "zfpFieldBase.c" 25 | 26 | #undef DIMS 27 | #undef ZFP_TYPE 28 | #undef SCALAR 29 | #undef NX 30 | #undef NY 31 | #undef NZ 32 | #undef NW 33 | #undef SX 34 | #undef SY 35 | #undef SZ 36 | #undef SW 37 | -------------------------------------------------------------------------------- /tests/src/misc/testZfpField4f.c: -------------------------------------------------------------------------------- 1 | #include "zfp.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #define DIMS 4 12 | #define ZFP_TYPE zfp_type_float 13 | #define SCALAR float 14 | 15 | #define NX 20 16 | #define NY 21 17 | #define NZ 12 18 | #define NW 6 19 | #define SX 2 20 | #define SY 3 21 | #define SZ 4 22 | #define SW 2 23 | 24 | #include "zfpFieldBase.c" 25 | 26 | #undef DIMS 27 | #undef ZFP_TYPE 28 | #undef SCALAR 29 | #undef NX 30 | #undef NY 31 | #undef NZ 32 | #undef NW 33 | #undef SX 34 | #undef SY 35 | #undef SZ 36 | #undef SW 37 | -------------------------------------------------------------------------------- /tests/utils/fixedpoint96.h: -------------------------------------------------------------------------------- 1 | #ifndef FIXEDPT_H 2 | #define FIXEDPT_H 3 | 4 | #include "include/zfp/internal/zfp/types.h" 5 | 6 | typedef struct { 7 | // the number represented = i + (2^-32)*f 8 | // integer part 9 | int64 i; 10 | // fractional part 11 | uint32 f; 12 | } fixedPt; 13 | 14 | void 15 | initFixedPt(int64 i, uint32 f, fixedPt* result); 16 | 17 | // functions with int return type: 18 | // return 0 if successful 19 | // return 1 if errored 20 | 21 | int 22 | roundFixedPt(fixedPt* fp, int64* result); 23 | 24 | int 25 | add(fixedPt* a, fixedPt* b, fixedPt* result); 26 | 27 | int 28 | subtract(fixedPt* a, fixedPt* b, fixedPt* result); 29 | 30 | int 31 | multiply(fixedPt* a, fixedPt* b, fixedPt* result); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /tests/utils/rand32.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rand32.h" 3 | 4 | #define SEED 5 5 | 6 | // POSIX rand48 7 | #define MULTIPLIER 0x5deece66d 8 | #define INCREMENT 0xb 9 | #define MODULO ((uint64)1 << 48) 10 | #define MASK_31 (0x7fffffffu) 11 | 12 | static uint64 X; 13 | 14 | void 15 | resetRandGen() 16 | { 17 | X = SEED; 18 | } 19 | 20 | // returns integer [0, 2^31 - 1] 21 | uint32 22 | nextUnsignedRand() 23 | { 24 | X = (MULTIPLIER*X + INCREMENT) % MODULO; 25 | return (uint32)((X >> 16) & MASK_31); 26 | } 27 | 28 | // returns integer [-(2^30), 2^30 - 1] 29 | int32 30 | nextSignedRandInt() 31 | { 32 | return (int32)nextUnsignedRand() - 0x40000000; 33 | } 34 | 35 | // returns float [-(2^11), 2^11 - 2^(-12)] 36 | float 37 | nextSignedRandFlPt() 38 | { 39 | // 23 bit signed number 40 | uint32 uVal = (nextUnsignedRand() >> 7) & 0x00ffffff; 41 | int32 sVal = (int32)uVal - 0x800000; 42 | return ldexpf((float)sVal, -12); 43 | } 44 | -------------------------------------------------------------------------------- /tests/utils/rand32.h: -------------------------------------------------------------------------------- 1 | #ifndef RAND_32_H 2 | #define RAND_32_H 3 | 4 | #include "include/zfp/internal/zfp/types.h" 5 | 6 | // reset seed 7 | void 8 | resetRandGen(); 9 | 10 | // returns integer [0, 2^31 - 1] 11 | uint32 12 | nextUnsignedRand(); 13 | 14 | // returns integer [-(2^30), 2^30 - 1] 15 | int32 16 | nextSignedRandInt(); 17 | 18 | // returns float [-(2^11), 2^11 - 2^(-12)] 19 | float 20 | nextSignedRandFlPt(); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /tests/utils/rand64.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rand64.h" 3 | 4 | #define SEED 5 5 | 6 | // https://nuclear.llnl.gov/CNP/rng/rngman/node4.html 7 | #define MULTIPLIER (2862933555777941757uLL) 8 | #define INCREMENT (3037000493uLL) 9 | 10 | #define MAX_RAND_63 (0x7fffffffffffffffuLL) 11 | 12 | static uint64 X; 13 | 14 | void 15 | resetRandGen() 16 | { 17 | X = SEED; 18 | } 19 | 20 | // returns integer [0, 2^63 - 1] 21 | uint64 22 | nextUnsignedRand() 23 | { 24 | // (mod 2^64) 25 | X = MULTIPLIER*X + INCREMENT; 26 | return (uint64)(X & MAX_RAND_63); 27 | } 28 | 29 | // returns integer [-(2^62), 2^62 - 1] 30 | int64 31 | nextSignedRandInt() 32 | { 33 | uint64 uDisplace = (uint64)1 << 62; 34 | return (int64)nextUnsignedRand() - (int64)uDisplace; 35 | } 36 | 37 | // returns double [-(2^26), 2^26 - 2^(-26)] 38 | double 39 | nextSignedRandFlPt() 40 | { 41 | // 52 bit signed number 42 | uint64 uVal = (nextUnsignedRand() >> 11) & 0x1fffffffffffff; 43 | int64 sVal = (int64)uVal - 0x10000000000000; 44 | return ldexp((double)sVal, -26); 45 | } 46 | 47 | // returns integer [0, 2^32 - 1] 48 | uint32 49 | nextRand32() 50 | { 51 | return (uint32)(nextUnsignedRand() >> 31); 52 | } 53 | -------------------------------------------------------------------------------- /tests/utils/rand64.h: -------------------------------------------------------------------------------- 1 | #ifndef RAND_64_H 2 | #define RAND_64_H 3 | 4 | #include "include/zfp/internal/zfp/types.h" 5 | 6 | // reset seed 7 | void 8 | resetRandGen(); 9 | 10 | // returns integer [0, 2^63 - 1] 11 | uint64 12 | nextUnsignedRand(); 13 | 14 | // returns integer [-(2^62), 2^62 - 1] 15 | int64 16 | nextSignedRandInt(); 17 | 18 | // returns double [-(2^26), 2^26 - 2^(-26)] 19 | double 20 | nextSignedRandFlPt(); 21 | 22 | // returns integer [0, 2^32 - 1] 23 | uint32 24 | nextRand32(); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /tests/utils/stridedOperations.h: -------------------------------------------------------------------------------- 1 | #ifndef STRIDED_OPERATIONS_H 2 | #define STRIDED_OPERATIONS_H 3 | 4 | #include 5 | #include "zfp.h" 6 | 7 | typedef enum { 8 | AS_IS = 0, 9 | PERMUTED = 1, 10 | INTERLEAVED = 2, 11 | REVERSED = 3, 12 | } stride_config; 13 | 14 | // reversed array ([inputLen - 1], [inputLen - 2], ..., [1], [0]) 15 | void 16 | reverseArray(void* inputArr, void* outputArr, size_t inputArrLen, zfp_type zfpType); 17 | 18 | // interleaved array ([0], [0], [1], [1], [2], ...) 19 | void 20 | interleaveArray(void* inputArr, void* outputArr, size_t inputArrLen, zfp_type zfpType); 21 | 22 | // ijkl -> lkji, or for lower dims (ex. ij -> ji) 23 | // returns 0 on success, 1 on failure 24 | // (defined to fail if dims == 1) 25 | int 26 | permuteSquareArray(void* inputArr, void* outputArr, size_t sideLen, int dims, zfp_type zfpType); 27 | 28 | void 29 | getReversedStrides(int dims, size_t n[4], ptrdiff_t s[4]); 30 | 31 | void 32 | getInterleavedStrides(int dims, size_t n[4], ptrdiff_t s[4]); 33 | 34 | void 35 | getPermutedStrides(int dims, size_t n[4], ptrdiff_t s[4]); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /tests/utils/zfpChecksums.h: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_CHECKSUMS_H 2 | #define ZFP_CHECKSUMS_H 3 | 4 | #include "zfp.h" 5 | 6 | typedef enum { 7 | BLOCK_FULL_TEST = 0, 8 | BLOCK_PARTIAL_TEST = 1, 9 | ARRAY_TEST = 2, 10 | } test_type; 11 | 12 | typedef enum { 13 | ORIGINAL_INPUT = 0, 14 | COMPRESSED_BITSTREAM = 1, 15 | DECOMPRESSED_ARRAY = 2, 16 | } subject; 17 | 18 | // key1 holds data about test type 19 | // key2 holds dimension lengths 20 | typedef struct { 21 | uint64 key1; 22 | uint64 key2; 23 | uint64 checksum; 24 | } checksum_tuples; 25 | 26 | void 27 | computeKeyOriginalInput(test_type tt, size_t n[4], uint64* key1, uint64* key2); 28 | 29 | void 30 | computeKey(test_type tt, subject sjt, size_t n[4], zfp_mode mode, int miscParam, uint64* key1, uint64* key2); 31 | 32 | uint64 33 | getChecksumByKey(int dims, zfp_type type, uint64 key1, uint64 key2); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /tests/utils/zfpCompressionParams.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "utils/zfpCompressionParams.h" 3 | 4 | int 5 | computeFixedPrecisionParam(int param) 6 | { 7 | return 1u << (param + 3); 8 | } 9 | 10 | size_t 11 | computeFixedRateParam(int param) 12 | { 13 | return (size_t)(1u << (param + 3)); 14 | } 15 | 16 | double 17 | computeFixedAccuracyParam(int param) 18 | { 19 | return ldexp(1.0, -(1u << param)); 20 | } 21 | -------------------------------------------------------------------------------- /tests/utils/zfpCompressionParams.h: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_COMPRESSION_PARAMS_H 2 | #define ZFP_COMPRESSION_PARAMS_H 3 | 4 | #include 5 | 6 | int 7 | computeFixedPrecisionParam(int param); 8 | 9 | size_t 10 | computeFixedRateParam(int param); 11 | 12 | double 13 | computeFixedAccuracyParam(int param); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /tests/utils/zfpHash.h: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_HASH_H 2 | #define ZFP_HASH_H 3 | 4 | #include 5 | #include "include/zfp/internal/zfp/types.h" 6 | 7 | uint64 8 | hashBitstream(uint64* ptrStart, size_t bufsizeBytes); 9 | 10 | // hash 32-bit valued arrays (int32, float) 11 | 12 | uint32 13 | hashArray32(const uint32* arr, size_t nx, ptrdiff_t sx); 14 | 15 | uint32 16 | hashStridedArray32(const uint32* arr, size_t n[4], ptrdiff_t s[4]); 17 | 18 | // hash 64-bit valued arrays (int64, double) 19 | 20 | uint64 21 | hashArray64(const uint64* arr, size_t nx, ptrdiff_t sx); 22 | 23 | uint64 24 | hashStridedArray64(const uint64* arr, size_t n[4], ptrdiff_t s[4]); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /tests/utils/zfpTimer.h: -------------------------------------------------------------------------------- 1 | #ifndef ZFP_TIMER_H 2 | #define ZFP_TIMER_H 3 | 4 | #if defined(__unix__) || defined(_WIN32) 5 | #include 6 | #elif defined(__MACH__) 7 | #include 8 | #endif 9 | 10 | typedef struct zfp_timer zfp_timer; 11 | 12 | zfp_timer* 13 | zfp_timer_alloc(); 14 | 15 | void 16 | zfp_timer_free(zfp_timer* timer); 17 | 18 | int 19 | zfp_timer_start(zfp_timer* timer); 20 | 21 | double 22 | zfp_timer_stop(zfp_timer* timer); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(zfpcmd zfp.c) 2 | 3 | # protect against LNK1114: cannot overwrite the original file 'lib/Release/zfp.lib'; error code 32; 4 | # rationale: linker can't handle the case of an executable file having the same name as a library file 5 | if(NOT MSVC) 6 | set_property(TARGET zfpcmd PROPERTY OUTPUT_NAME zfp) 7 | endif() 8 | target_link_libraries(zfpcmd zfp) 9 | if(HAVE_LIBM_MATH) 10 | target_link_libraries(zfpcmd m) 11 | endif() 12 | 13 | if(BUILD_UTILITIES) 14 | install(TARGETS zfpcmd 15 | DESTINATION "${CMAKE_INSTALL_BINDIR}") 16 | endif() 17 | -------------------------------------------------------------------------------- /utils/Makefile: -------------------------------------------------------------------------------- 1 | include ../Config 2 | 3 | TARGET = ../bin/zfp 4 | INCS = -I../include 5 | LIBS = -L../lib -lzfp $(LDFLAGS) -lm 6 | 7 | all: $(TARGET) 8 | 9 | $(TARGET): zfp.c ../lib/$(LIBZFP) 10 | mkdir -p ../bin 11 | $(CC) $(CFLAGS) $(INCS) zfp.c $(LIBS) -o $(TARGET) 12 | 13 | clean: 14 | rm -f $(TARGET) fields.o 15 | -------------------------------------------------------------------------------- /zfp-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION_MAJOR @ZFP_VERSION_MAJOR@) 2 | set(PACKAGE_VERSION_MINOR @ZFP_VERSION_MINOR@) 3 | set(PACKAGE_VERSION_PATCH @ZFP_VERSION_PATCH@) 4 | set(PACKAGE_VERSION_TWEAK @ZFP_VERSION_TWEAK@) 5 | 6 | set(PACKAGE_VERSION @ZFP_VERSION@) 7 | 8 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 9 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION OR 10 | PACKAGE_VERSION_MAJOR GREATER PACKAGE_FIND_VERSION_MAJOR) 11 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 12 | else() 13 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 14 | if(PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) 15 | set(PACKAGE_VERSION_EXACT TRUE) 16 | endif() 17 | endif() 18 | --------------------------------------------------------------------------------