-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert blosc2 to v2.8.0 to remove new dependency libdl
- Loading branch information
Showing
58 changed files
with
773 additions
and
1,397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ BSD License | |
For Blosc - A blocking, shuffling and lossless compression library | ||
|
||
Copyright (C) 2009-2018 Francesc Alted <[email protected]> | ||
Copyright (C) 2019- The Blosc Development Team <[email protected]> | ||
Copyright (C) 2019-present Blosc Development team <[email protected]> | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
See LICENSE.txt for details about copyright and rights to use. | ||
**********************************************************************/ | ||
|
||
#include "b2nd.h" | ||
#include "b2nd_utils.h" | ||
#include <b2nd.h> | ||
#include "context.h" | ||
#include "blosc2/blosc2-common.h" | ||
#include "b2nd_utils.h" | ||
#include "blosc2.h" | ||
|
||
#include "blosc2/blosc2-common.h" | ||
#include <inttypes.h> | ||
#include <stdlib.h> | ||
#include <stdint.h> | ||
#include <string.h> | ||
|
||
|
||
int b2nd_serialize_meta(int8_t ndim, const int64_t *shape, const int32_t *chunkshape, | ||
|
@@ -176,8 +172,8 @@ int update_shape(b2nd_array_t *array, int8_t ndim, const int64_t *shape, | |
b2nd_serialize_meta(array->ndim, array->shape, array->chunkshape, array->blockshape, | ||
array->dtype, array->dtype_format, &smeta); | ||
if (smeta_len < 0) { | ||
BLOSC_TRACE_ERROR("Error during serializing dims info for Blosc2 NDim"); | ||
BLOSC_ERROR(BLOSC2_ERROR_FAILURE); | ||
fprintf(stderr, "error during serializing dims info for Blosc2 NDim"); | ||
return -1; | ||
} | ||
// ... and update it in its metalayer | ||
if (blosc2_meta_exists(array->sc, "b2nd") < 0) { | ||
|
@@ -269,10 +265,6 @@ int array_new(b2nd_context_t *ctx, int special_value, b2nd_array_t **array) { | |
} | ||
} | ||
|
||
if ((*array)->extchunknitems * sc->typesize > BLOSC2_MAX_BUFFERSIZE){ | ||
BLOSC_TRACE_ERROR("Chunksize exceeds maximum of %d", BLOSC2_MAX_BUFFERSIZE); | ||
return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED; | ||
} | ||
// Fill schunk with uninit values | ||
if ((*array)->nitems != 0) { | ||
int32_t chunksize = (int32_t) (*array)->extchunknitems * sc->typesize; | ||
|
@@ -603,7 +595,7 @@ int get_set_slice(void *buffer, int64_t buffersize, const int64_t *start, const | |
int64_t nchunk; | ||
blosc2_multidim_to_unidim(nchunk_ndim, ndim, chunks_in_array_strides, &nchunk); | ||
|
||
// Check if the chunk needs to be updated | ||
// check if the chunk needs to be updated | ||
int64_t chunk_start[B2ND_MAX_DIM] = {0}; | ||
int64_t chunk_stop[B2ND_MAX_DIM] = {0}; | ||
for (int i = 0; i < ndim; ++i) { | ||
|
@@ -648,7 +640,7 @@ int get_set_slice(void *buffer, int64_t buffersize, const int64_t *start, const | |
int64_t nblock_ndim[B2ND_MAX_DIM] = {0}; | ||
blosc2_unidim_to_multidim(ndim, blocks_in_chunk, nblock, nblock_ndim); | ||
|
||
// Check if the block needs to be updated | ||
// check if the block needs to be updated | ||
int64_t block_start[B2ND_MAX_DIM] = {0}; | ||
int64_t block_stop[B2ND_MAX_DIM] = {0}; | ||
for (int i = 0; i < ndim; ++i) { | ||
|
@@ -692,7 +684,7 @@ int get_set_slice(void *buffer, int64_t buffersize, const int64_t *start, const | |
int64_t nblock_ndim[B2ND_MAX_DIM] = {0}; | ||
blosc2_unidim_to_multidim(ndim, blocks_in_chunk, nblock, nblock_ndim); | ||
|
||
// Check if the block needs to be updated | ||
// check if the block needs to be updated | ||
int64_t block_start[B2ND_MAX_DIM] = {0}; | ||
int64_t block_stop[B2ND_MAX_DIM] = {0}; | ||
for (int i = 0; i < ndim; ++i) { | ||
|
@@ -891,7 +883,7 @@ int b2nd_get_slice(b2nd_context_t *ctx, b2nd_array_t **array, const b2nd_array_t | |
int64_t nchunk_ndim[B2ND_MAX_DIM] = {0}; | ||
blosc2_unidim_to_multidim(ndim, chunks_in_array, nchunk, nchunk_ndim); | ||
|
||
// Check if the chunk needs to be updated | ||
// check if the chunk needs to be updated | ||
int64_t chunk_start[B2ND_MAX_DIM] = {0}; | ||
int64_t chunk_stop[B2ND_MAX_DIM] = {0}; | ||
int64_t chunk_shape[B2ND_MAX_DIM] = {0}; | ||
|
@@ -1100,7 +1092,7 @@ int b2nd_print_meta(const b2nd_array_t *array) { | |
&dtype, &dtype_format)); | ||
free(smeta); | ||
|
||
printf("b2nd metalayer parameters:\n Ndim: %d", ndim); | ||
printf("b2nd metalayer parameters: \n Ndim: %d", ndim); | ||
printf("\n shape: %" PRId64 "", shape[0]); | ||
for (int i = 1; i < ndim; ++i) { | ||
printf(", %" PRId64 "", shape[i]); | ||
|
@@ -1824,20 +1816,6 @@ b2nd_create_ctx(const blosc2_storage *b2_storage, int8_t ndim, const int64_t *sh | |
ctx->metalayers[i] = metalayers[i]; | ||
} | ||
|
||
#if defined(HAVE_PLUGINS) | ||
#include "blosc2/codecs-registry.h" | ||
if ((ctx->b2_storage->cparams->compcode >= BLOSC_CODEC_ZFP_FIXED_ACCURACY) && | ||
(ctx->b2_storage->cparams->compcode <= BLOSC_CODEC_ZFP_FIXED_RATE)) { | ||
for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) { | ||
if ((ctx->b2_storage->cparams->filters[i] == BLOSC_SHUFFLE) || | ||
(ctx->b2_storage->cparams->filters[i] == BLOSC_BITSHUFFLE)) { | ||
BLOSC_TRACE_ERROR("ZFP cannot be run in presence of SHUFFLE / BITSHUFFLE"); | ||
return NULL; | ||
} | ||
} | ||
} | ||
#endif /* HAVE_PLUGINS */ | ||
|
||
return ctx; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
See LICENSE.txt for details about copyright and rights to use. | ||
**********************************************************************/ | ||
|
||
#include "b2nd_utils.h" | ||
#include "b2nd.h" | ||
|
||
#include <stdint.h> | ||
#include <string.h> | ||
#include <b2nd_utils.h> | ||
|
||
// copyNdim where N = {2-8} - specializations of copy loops to be used by b2nd_copy_buffer | ||
// since we don't have c++ templates, substitute manual specializations for up to known B2ND_MAX_DIM (8) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
See LICENSE.txt for details about copyright and rights to use. | ||
**********************************************************************/ | ||
|
||
#ifndef BLOSC_B2ND_UTILS_H | ||
#define BLOSC_B2ND_UTILS_H | ||
#ifndef B2ND_B2ND_UTILS_H_ | ||
#define B2ND_B2ND_UTILS_H_ | ||
|
||
#include <b2nd.h> | ||
#include <../plugins/plugin_utils.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdint.h> | ||
|
||
int b2nd_copy_buffer(int8_t ndim, | ||
uint8_t itemsize, | ||
|
@@ -20,4 +26,8 @@ int b2nd_copy_buffer(int8_t ndim, | |
void *dst, const int64_t *dst_pad_shape, | ||
int64_t *dst_start); | ||
|
||
#endif /* BLOSC_B2ND_UTILS_H */ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // B2ND_B2ND_UTILS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
|
@@ -22,17 +22,14 @@ | |
**********************************************************************/ | ||
|
||
|
||
#include "bitshuffle-altivec.h" | ||
#include "bitshuffle-generic.h" | ||
#include "bitshuffle-altivec.h" | ||
|
||
/* Make sure ALTIVEC is available for the compilation target and compiler. */ | ||
#if defined(__ALTIVEC__) | ||
|
||
#include "transpose-altivec.h" | ||
|
||
#include <altivec.h> | ||
|
||
#include <stdint.h> | ||
#include "transpose-altivec.h" | ||
|
||
/* The next is useful for debugging purposes */ | ||
#if 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
|
@@ -10,13 +10,15 @@ | |
|
||
/* ALTIVEC-accelerated shuffle/unshuffle routines. */ | ||
|
||
#ifndef BLOSC_BITSHUFFLE_ALTIVEC_H | ||
#define BLOSC_BITSHUFFLE_ALTIVEC_H | ||
#ifndef BITSHUFFLE_ALTIVEC_H | ||
#define BITSHUFFLE_ALTIVEC_H | ||
|
||
#include "blosc2/blosc2-common.h" | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
|
||
BLOSC_NO_EXPORT int64_t | ||
bshuf_trans_byte_elem_altivec(void* in, void* out, const size_t size, | ||
|
@@ -44,4 +46,9 @@ BLOSC_NO_EXPORT int64_t | |
bshuf_untrans_bit_elem_altivec(void* in, void* out, const size_t size, | ||
const size_t elem_size, void* tmp_buf); | ||
|
||
#endif /* BLOSC_BITSHUFFLE_ALTIVEC_H */ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
|
||
#endif /* BITSHUFFLE_ALTIVEC_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
|
@@ -20,17 +20,17 @@ | |
rights to use. | ||
**********************************************************************/ | ||
|
||
#include "bitshuffle-avx2.h" | ||
#include "bitshuffle-sse2.h" | ||
|
||
#include "bitshuffle-generic.h" | ||
#include "bitshuffle-sse2.h" | ||
#include "bitshuffle-avx2.h" | ||
|
||
|
||
/* Make sure AVX2 is available for the compilation target and compiler. */ | ||
#if defined(__AVX2__) | ||
|
||
#include <immintrin.h> | ||
|
||
#include <stdint.h> | ||
|
||
/* The next is useful for debugging purposes */ | ||
#if 0 | ||
#include <stdio.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
|
@@ -10,13 +10,14 @@ | |
|
||
/* AVX2-accelerated shuffle/unshuffle routines. */ | ||
|
||
#ifndef BLOSC_BITSHUFFLE_AVX2_H | ||
#define BLOSC_BITSHUFFLE_AVX2_H | ||
#ifndef BITSHUFFLE_AVX2_H | ||
#define BITSHUFFLE_AVX2_H | ||
|
||
#include "blosc2/blosc2-common.h" | ||
#include <blosc2/blosc2-common.h> | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
AVX2-accelerated bitshuffle routine. | ||
|
@@ -32,4 +33,8 @@ BLOSC_NO_EXPORT int64_t | |
bshuf_untrans_bit_elem_avx2(void* in, void* out, const size_t size, | ||
const size_t elem_size, void* tmp_buf); | ||
|
||
#endif /* BLOSC_BITSHUFFLE_AVX2_H */ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* BITSHUFFLE_AVX2_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/********************************************************************* | ||
Blosc - Blocked Shuffling and Compression Library | ||
Copyright (c) 2021 The Blosc Development Team <[email protected]> | ||
Copyright (C) 2021 The Blosc Developers <[email protected]> | ||
https://blosc.org | ||
License: BSD 3-Clause (see LICENSE.txt) | ||
|
@@ -10,8 +10,6 @@ | |
|
||
#include "bitshuffle-generic.h" | ||
|
||
#include <stdint.h> | ||
|
||
#ifdef _MSC_VER | ||
#pragma warning (push) | ||
#pragma warning (disable: 4146) | ||
|
Oops, something went wrong.