forked from IlyaGrebnov/libbsc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cedce3
commit cb2ceeb
Showing
36 changed files
with
931 additions
and
65 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 |
---|---|---|
|
@@ -10,7 +10,7 @@ block-sorting data compression algorithms. | |
libbsc is a library based on bsc, it uses the same algorithms | ||
as bsc and enables you to compress memory blocks. | ||
|
||
Copyright (c) 2009-2023 Ilya Grebnov <[email protected]> | ||
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]> | ||
|
||
See file AUTHORS for a full list of contributors. | ||
|
||
|
@@ -21,7 +21,7 @@ See the bsc and libbsc web site: | |
Software License: | ||
----------------- | ||
|
||
Copyright (c) 2009-2023 Ilya Grebnov <[email protected]> | ||
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]> | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -54,7 +54,8 @@ Compression and decompression requirements are the same and in bytes, can | |
be estimated as 16Mb + 5 x block size x number of blocks processed in parallel. | ||
|
||
GPU memory usage for NVIDIA CUDA technology is different from CPU memory usage | ||
and can be estimated as 20 x block size for ST and 21 x block size for BWT. | ||
and can be estimated as 20 x block size for ST, 21 x block size for forward BWT | ||
and 7 x block size for inverse BWT. | ||
|
||
|
||
NVIDIA GPU acceleration: | ||
|
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 +1 @@ | ||
3.3.3 | ||
3.3.4 |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
This file is a part of bsc and/or libbsc, a program and a library for | ||
lossless, block-sorting data compression. | ||
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]> | ||
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -869,8 +869,8 @@ void ProcessCommandline(int argc, char * argv[]) | |
|
||
int main(int argc, char * argv[]) | ||
{ | ||
fprintf(stdout, "This is bsc, Block Sorting Compressor. Version 3.3.3. 26 November 2023.\n"); | ||
fprintf(stdout, "Copyright (c) 2009-2023 Ilya Grebnov <[email protected]>.\n\n"); | ||
fprintf(stdout, "This is bsc, Block Sorting Compressor. Version 3.3.4. 24 January 2024.\n"); | ||
fprintf(stdout, "Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>.\n\n"); | ||
|
||
#if defined(_OPENMP) && defined(__INTEL_COMPILER) | ||
|
||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
This file is a part of bsc and/or libbsc, a program and a library for | ||
lossless, block-sorting data compression. | ||
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]> | ||
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
This file is a part of bsc and/or libbsc, a program and a library for | ||
lossless, block-sorting data compression. | ||
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]> | ||
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
This file is a part of bsc and/or libbsc, a program and a library for | ||
lossless, block-sorting data compression. | ||
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]> | ||
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -226,13 +226,63 @@ int bsc_bwt_encode(unsigned char * T, int n, unsigned char * num_indexes, int * | |
return LIBBSC_NOT_ENOUGH_MEMORY; | ||
} | ||
|
||
int bsc_bwt_gpu_decode(unsigned char * T, int n, int index, int features) | ||
{ | ||
int result = -1; | ||
|
||
#ifdef LIBBSC_CUDA_SUPPORT | ||
if (features & LIBBSC_FEATURE_CUDA) | ||
{ | ||
int storage_approx_length = (n / 3) | 0x1fffff; | ||
|
||
#ifdef LIBBSC_OPENMP | ||
omp_set_lock(&bwt_cuda_lock); | ||
|
||
if (bwt_cuda_device_storage_size < storage_approx_length) | ||
{ | ||
if (bwt_cuda_device_storage != NULL) | ||
{ | ||
libcubwt_free_device_storage(bwt_cuda_device_storage); | ||
|
||
bwt_cuda_device_storage = NULL; | ||
bwt_cuda_device_storage_size = 0; | ||
} | ||
|
||
if (libcubwt_allocate_device_storage(&bwt_cuda_device_storage, storage_approx_length + (storage_approx_length / 32)) == LIBCUBWT_NO_ERROR) | ||
{ | ||
bwt_cuda_device_storage_size = storage_approx_length + (storage_approx_length / 32); | ||
} | ||
} | ||
|
||
if (bwt_cuda_device_storage_size >= storage_approx_length) | ||
{ | ||
result = (int)libcubwt_unbwt(bwt_cuda_device_storage, T, T, n, NULL, index); | ||
} | ||
|
||
omp_unset_lock(&bwt_cuda_lock); | ||
#else | ||
void * bwt_cuda_device_storage = NULL; | ||
|
||
if (libcubwt_allocate_device_storage(&bwt_cuda_device_storage, storage_approx_length) == LIBCUBWT_NO_ERROR) | ||
{ | ||
result = (int)libcubwt_unbwt(bwt_cuda_device_storage, T, T, n, NULL, index); | ||
|
||
libcubwt_free_device_storage(bwt_cuda_device_storage); | ||
} | ||
#endif | ||
} | ||
#endif | ||
|
||
return result; | ||
} | ||
|
||
int bsc_bwt_decode(unsigned char * T, int n, int index, unsigned char num_indexes, int * indexes, int features) | ||
{ | ||
if ((T == NULL) || (n < 0) || (index <= 0) || (index > n)) | ||
{ | ||
return LIBBSC_BAD_PARAMETER; | ||
} | ||
if (n <= 1) | ||
if (n <= 1 || bsc_bwt_gpu_decode(T, n, index, features) == 0) | ||
{ | ||
return LIBBSC_NO_ERROR; | ||
} | ||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
This file is a part of bsc and/or libbsc, a program and a library for | ||
lossless, block-sorting data compression. | ||
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]> | ||
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
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
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 +1 @@ | ||
1.5.0 | ||
1.6.0 |
Oops, something went wrong.