From 18c8f5a1a8c7b208456dce5a4967c8574d1ea125 Mon Sep 17 00:00:00 2001 From: Ilya Grebnov Date: Wed, 31 Jul 2024 12:15:59 -0700 Subject: [PATCH] Miscellaneous changes to reduce compiler warnings about implicit functions. --- CHANGES | 3 +++ CMakeLists.txt | 2 +- README.md | 4 +++- VERSION | 2 +- include/libsais.h | 4 ++-- include/libsais16.h | 4 ++-- include/libsais16x64.h | 4 ++-- include/libsais64.h | 4 ++-- src/libsais.c | 17 ++++++++--------- src/libsais16.c | 17 ++++++++--------- src/libsais16x64.c | 17 ++++++++--------- src/libsais64.c | 17 ++++++++--------- 12 files changed, 48 insertions(+), 47 deletions(-) diff --git a/CHANGES b/CHANGES index 02ef3c6..0c2255e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +Changes in 2.8.5 (July 31, 2024) +- Miscellaneous changes to reduce compiler warnings about implicit functions. + Changes in 2.8.4 (June 13, 2024) - Additional OpenMP acceleration (libsais16 & libsais16x64). diff --git a/CMakeLists.txt b/CMakeLists.txt index 967fabf..da3be98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) -project(libsais VERSION 2.8.4 LANGUAGES C DESCRIPTION "libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.") +project(libsais VERSION 2.8.5 LANGUAGES C DESCRIPTION "libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.") set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) diff --git a/README.md b/README.md index e0a8b3e..e35519b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ The libsais provides simple C99 API to construct suffix array and Burrows-Wheele The libsais is released under the [Apache License Version 2.0](LICENSE "Apache license") ## Changes +* July 31, 2024 (2.8.5) + * Miscellaneous changes to reduce compiler warnings about implicit functions. * June 13, 2024 (2.8.4) * Additional OpenMP acceleration (libsais16 & libsais16x64). * June 11, 2024 (2.8.3) @@ -129,7 +131,7 @@ The libsais is released under the [Apache License Version 2.0](LICENSE "Apache l CPMAddPackage( NAME libsais GITHUB_REPOSITORY IlyaGrebnov/libsais - GIT_TAG v2.8.3 + GIT_TAG v2.8.5 OPTIONS "LIBSAIS_USE_OPENMP OFF" "LIBSAIS_BUILD_SHARED_LIB OFF" diff --git a/VERSION b/VERSION index 2701a22..766d708 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.8.4 +2.8.5 diff --git a/include/libsais.h b/include/libsais.h index d8b02fe..86df9f2 100644 --- a/include/libsais.h +++ b/include/libsais.h @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information. #define LIBSAIS_VERSION_MAJOR 2 #define LIBSAIS_VERSION_MINOR 8 -#define LIBSAIS_VERSION_PATCH 4 -#define LIBSAIS_VERSION_STRING "2.8.4" +#define LIBSAIS_VERSION_PATCH 5 +#define LIBSAIS_VERSION_STRING "2.8.5" #ifdef _WIN32 #ifdef LIBSAIS_SHARED diff --git a/include/libsais16.h b/include/libsais16.h index f6ed80b..53e2540 100644 --- a/include/libsais16.h +++ b/include/libsais16.h @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information. #define LIBSAIS16_VERSION_MAJOR 2 #define LIBSAIS16_VERSION_MINOR 8 -#define LIBSAIS16_VERSION_PATCH 4 -#define LIBSAIS16_VERSION_STRING "2.8.4" +#define LIBSAIS16_VERSION_PATCH 5 +#define LIBSAIS16_VERSION_STRING "2.8.5" #ifdef _WIN32 #ifdef LIBSAIS_SHARED diff --git a/include/libsais16x64.h b/include/libsais16x64.h index c05a2a3..a9fd3c2 100644 --- a/include/libsais16x64.h +++ b/include/libsais16x64.h @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information. #define LIBSAIS16X64_VERSION_MAJOR 2 #define LIBSAIS16X64_VERSION_MINOR 8 -#define LIBSAIS16X64_VERSION_PATCH 4 -#define LIBSAIS16X64_VERSION_STRING "2.8.4" +#define LIBSAIS16X64_VERSION_PATCH 5 +#define LIBSAIS16X64_VERSION_STRING "2.8.5" #ifdef _WIN32 #ifdef LIBSAIS_SHARED diff --git a/include/libsais64.h b/include/libsais64.h index 70d50ee..0189f19 100644 --- a/include/libsais64.h +++ b/include/libsais64.h @@ -26,8 +26,8 @@ Please see the file LICENSE for full copyright information. #define LIBSAIS64_VERSION_MAJOR 2 #define LIBSAIS64_VERSION_MINOR 8 -#define LIBSAIS64_VERSION_PATCH 4 -#define LIBSAIS64_VERSION_STRING "2.8.4" +#define LIBSAIS64_VERSION_PATCH 5 +#define LIBSAIS64_VERSION_STRING "2.8.5" #ifdef _WIN32 #ifdef LIBSAIS_SHARED diff --git a/src/libsais.c b/src/libsais.c index 02ad723..c16b2d6 100644 --- a/src/libsais.c +++ b/src/libsais.c @@ -31,7 +31,6 @@ Please see the file LICENSE for full copyright information. #if defined(LIBSAIS_OPENMP) #include - #include #else #define UNUSED(_x) (void)(_x) #endif @@ -2205,7 +2204,7 @@ static void libsais_partial_sorting_scan_left_to_right_8u_block_place(sa_sint_t static sa_sint_t libsais_partial_sorting_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -3037,7 +3036,7 @@ static void libsais_partial_sorting_scan_right_to_left_8u_block_place(sa_sint_t static sa_sint_t libsais_partial_sorting_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4777,7 +4776,7 @@ static void libsais_final_sorting_scan_left_to_right_32s_block_sort(const sa_sin static void libsais_final_bwt_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4831,7 +4830,7 @@ static void libsais_final_bwt_scan_left_to_right_8u_block_omp(const uint8_t * RE static void libsais_final_bwt_aux_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4885,7 +4884,7 @@ static void libsais_final_bwt_aux_scan_left_to_right_8u_block_omp(const uint8_t static void libsais_final_sorting_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5432,7 +5431,7 @@ static void libsais_final_sorting_scan_right_to_left_32s_block_sort(const sa_sin static void libsais_final_bwt_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5486,7 +5485,7 @@ static void libsais_final_bwt_scan_right_to_left_8u_block_omp(const uint8_t * RE static void libsais_final_bwt_aux_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5540,7 +5539,7 @@ static void libsais_final_bwt_aux_scan_right_to_left_8u_block_omp(const uint8_t static void libsais_final_sorting_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) diff --git a/src/libsais16.c b/src/libsais16.c index 6f7c7e9..c800f8f 100644 --- a/src/libsais16.c +++ b/src/libsais16.c @@ -31,7 +31,6 @@ Please see the file LICENSE for full copyright information. #if defined(LIBSAIS_OPENMP) #include - #include #else #define UNUSED(_x) (void)(_x) #endif @@ -2183,7 +2182,7 @@ static void libsais16_partial_sorting_scan_left_to_right_16u_block_place(sa_sint static sa_sint_t libsais16_partial_sorting_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -3015,7 +3014,7 @@ static void libsais16_partial_sorting_scan_right_to_left_16u_block_place(sa_sint static sa_sint_t libsais16_partial_sorting_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4755,7 +4754,7 @@ static void libsais16_final_sorting_scan_left_to_right_32s_block_sort(const sa_s static void libsais16_final_bwt_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4809,7 +4808,7 @@ static void libsais16_final_bwt_scan_left_to_right_16u_block_omp(const uint16_t static void libsais16_final_bwt_aux_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4863,7 +4862,7 @@ static void libsais16_final_bwt_aux_scan_left_to_right_16u_block_omp(const uint1 static void libsais16_final_sorting_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5410,7 +5409,7 @@ static void libsais16_final_sorting_scan_right_to_left_32s_block_sort(const sa_s static void libsais16_final_bwt_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5464,7 +5463,7 @@ static void libsais16_final_bwt_scan_right_to_left_16u_block_omp(const uint16_t static void libsais16_final_bwt_aux_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5518,7 +5517,7 @@ static void libsais16_final_bwt_aux_scan_right_to_left_16u_block_omp(const uint1 static void libsais16_final_sorting_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) diff --git a/src/libsais16x64.c b/src/libsais16x64.c index 462622a..299b3d0 100644 --- a/src/libsais16x64.c +++ b/src/libsais16x64.c @@ -32,7 +32,6 @@ Please see the file LICENSE for full copyright information. #if defined(LIBSAIS_OPENMP) #include - #include #else #define UNUSED(_x) (void)(_x) #endif @@ -2153,7 +2152,7 @@ static void libsais16x64_partial_sorting_scan_left_to_right_16u_block_place(sa_s static sa_sint_t libsais16x64_partial_sorting_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -2985,7 +2984,7 @@ static void libsais16x64_partial_sorting_scan_right_to_left_16u_block_place(sa_s static sa_sint_t libsais16x64_partial_sorting_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4725,7 +4724,7 @@ static void libsais16x64_final_sorting_scan_left_to_right_32s_block_sort(const s static void libsais16x64_final_bwt_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4779,7 +4778,7 @@ static void libsais16x64_final_bwt_scan_left_to_right_16u_block_omp(const uint16 static void libsais16x64_final_bwt_aux_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4833,7 +4832,7 @@ static void libsais16x64_final_bwt_aux_scan_left_to_right_16u_block_omp(const ui static void libsais16x64_final_sorting_scan_left_to_right_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5380,7 +5379,7 @@ static void libsais16x64_final_sorting_scan_right_to_left_32s_block_sort(const s static void libsais16x64_final_bwt_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5434,7 +5433,7 @@ static void libsais16x64_final_bwt_scan_right_to_left_16u_block_omp(const uint16 static void libsais16x64_final_bwt_aux_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5488,7 +5487,7 @@ static void libsais16x64_final_bwt_aux_scan_right_to_left_16u_block_omp(const ui static void libsais16x64_final_sorting_scan_right_to_left_16u_block_omp(const uint16_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) diff --git a/src/libsais64.c b/src/libsais64.c index b34d41d..226771c 100644 --- a/src/libsais64.c +++ b/src/libsais64.c @@ -32,7 +32,6 @@ Please see the file LICENSE for full copyright information. #if defined(LIBSAIS_OPENMP) #include - #include #else #define UNUSED(_x) (void)(_x) #endif @@ -2175,7 +2174,7 @@ static void libsais64_partial_sorting_scan_left_to_right_8u_block_place(sa_sint_ static sa_sint_t libsais64_partial_sorting_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -3007,7 +3006,7 @@ static void libsais64_partial_sorting_scan_right_to_left_8u_block_place(sa_sint_ static sa_sint_t libsais64_partial_sorting_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT buckets, sa_sint_t d, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4747,7 +4746,7 @@ static void libsais64_final_sorting_scan_left_to_right_32s_block_sort(const sa_s static void libsais64_final_bwt_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4801,7 +4800,7 @@ static void libsais64_final_bwt_scan_left_to_right_8u_block_omp(const uint8_t * static void libsais64_final_bwt_aux_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -4855,7 +4854,7 @@ static void libsais64_final_bwt_aux_scan_left_to_right_8u_block_omp(const uint8_ static void libsais64_final_sorting_scan_left_to_right_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5402,7 +5401,7 @@ static void libsais64_final_sorting_scan_right_to_left_32s_block_sort(const sa_s static void libsais64_final_bwt_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5456,7 +5455,7 @@ static void libsais64_final_bwt_scan_right_to_left_8u_block_omp(const uint8_t * static void libsais64_final_bwt_aux_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t rm, sa_sint_t * RESTRICT I, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP) @@ -5510,7 +5509,7 @@ static void libsais64_final_bwt_aux_scan_right_to_left_8u_block_omp(const uint8_ static void libsais64_final_sorting_scan_right_to_left_8u_block_omp(const uint8_t * RESTRICT T, sa_sint_t * RESTRICT SA, sa_sint_t k, sa_sint_t * RESTRICT induction_bucket, fast_sint_t block_start, fast_sint_t block_size, sa_sint_t threads, LIBSAIS_THREAD_STATE * RESTRICT thread_state) { #if defined(LIBSAIS_OPENMP) - #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * MAX(k, 256) && omp_get_dynamic() == 0) + #pragma omp parallel num_threads(threads) if(threads > 1 && block_size >= 64 * (k > 256 ? k : 256) && omp_get_dynamic() == 0) #endif { #if defined(LIBSAIS_OPENMP)