Skip to content

Commit

Permalink
Miscellaneous changes to reduce compiler warnings about implicit func…
Browse files Browse the repository at this point in the history
…tions.
  • Loading branch information
IlyaGrebnov committed Jul 31, 2024
1 parent 60f8369 commit 18c8f5a
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 47 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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).

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.4
2.8.5
4 changes: 2 additions & 2 deletions include/libsais.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/libsais16.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/libsais16x64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/libsais64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 8 additions & 9 deletions src/libsais.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Please see the file LICENSE for full copyright information.

#if defined(LIBSAIS_OPENMP)
#include <omp.h>
#include <sys/param.h>
#else
#define UNUSED(_x) (void)(_x)
#endif
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 8 additions & 9 deletions src/libsais16.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Please see the file LICENSE for full copyright information.

#if defined(LIBSAIS_OPENMP)
#include <omp.h>
#include <sys/param.h>
#else
#define UNUSED(_x) (void)(_x)
#endif
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 18c8f5a

Please sign in to comment.