Skip to content

[C API] Add OpenMP support validation in ThreadPoolBuilder - #412

Open
rfsaliev wants to merge 1 commit into
mainfrom
rfsaliev/c-api-fix-omp
Open

rfsaliev wants to merge 1 commit into
mainfrom
rfsaliev/c-api-fix-omp

Conversation

@rfsaliev

@rfsaliev rfsaliev commented Oct 6, 2026

Copy link
Copy Markdown
Member

This pull request improves the handling and documentation of OpenMP thread pool support in the C bindings. It ensures that OpenMP-based thread pools are only available when the library is built with OpenMP support, and provides clearer error handling and documentation for this scenario. The changes also update tests and CMake configuration to reflect these improvements.

OpenMP Support Handling and Error Reporting

  • The CMake configuration now only enables OpenMP support if it is found. OpenMP-related compile definitions are added conditionally. (bindings/c/CMakeLists.txt)
  • The C API and implementation now check at runtime whether OpenMP support is enabled. If not, selecting the OpenMP thread pool kind results in a SVS_ERROR_NOT_IMPLEMENTED error. (bindings/c/include/svs/c/svs_c.h, bindings/c/src/threadpool.hpp) [1] [2] [3] [4]

Documentation Updates

  • The documentation for thread pool configuration and related API functions has been updated to clarify that OpenMP support is only available if the library was built with OpenMP, and to describe the resulting error codes when it is not. (bindings/c/docs/C_API_Design.md, bindings/c/include/svs/c/svs_c.h) [1] [2]

Test Improvements

  • Unit tests have been updated to account for the possibility that OpenMP is not implemented. Tests now check for the appropriate error code (SVS_ERROR_NOT_IMPLEMENTED) when OpenMP support is unavailable. (bindings/c/tests/c_api_index.cpp, bindings/c/tests/c_api_index_builder.cpp) [1] [2] [3]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C API] Guard SVS_THREADPOOL_KIND_OMP case in threadpool.hpp behind #if SVS_OMP

1 participant