feature: switch threader_for to int64 indices#3471
feature: switch threader_for to int64 indices#3471Alexandr-Solovev wants to merge 7 commits intouxlfoundation:mainfrom
Conversation
|
/intelci: run |
|
The changes look good to me. Please also update the .github/.abignore file, as threading layer is not a part of our ABI, as those functions are not available to users, they are only available internally in oneDAL. Please add the following section and list the threading symbols there: |
There was a problem hiding this comment.
Pull request overview
This PR implements an ABI-breaking change that migrates threading functions to use 64-bit indices (int64_t) instead of 32-bit (int32_t). The change consolidates the separate threader_for and threader_for_int64 functions into a single unified implementation.
Changes:
- Updated
_onedal_threader_forand_daal_threader_forfunction signatures to useint64_tparameters - Removed the deprecated
_onedal_threader_for_int64and_daal_threader_for_int64functions - Updated all call sites to use the unified
threader_forwith explicit count parameter
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cpp/oneapi/dal/detail/threading.hpp | Updated function signatures and removed int64-specific variants |
| cpp/oneapi/dal/backend/interop/threading.cpp | Updated implementation to use int64_t parameters |
| cpp/daal/src/threading/threading.h | Changed exported function signatures to int64_t |
| cpp/daal/src/threading/threading.cpp | Consolidated implementation to single int64_t version |
| cpp/daal/src/externals/core_threading_win_dll.cpp | Updated Windows DLL function pointer types |
| cpp/oneapi/dal/table/backend/convert/copy_convert_impl_cpu.cpp | Updated call sites to new API |
| cpp/oneapi/dal/io/csv/detail/read_graph_kernel_impl.hpp | Updated call sites to new API |
| cpp/oneapi/dal/algo/basic_statistics/backend/cpu/apply_weights_cpu.cpp | Updated call site to new API |
| .github/.abignore | Added suppression for removed function in ABI compatibility checks |
| const std::int64_t col_count = shape.second; | ||
|
|
||
| detail::threader_for_int64(row_count, [&](std::int64_t i) -> void { | ||
| detail::threader_for(row_count, row_count, [&](std::int64_t i) -> void { |
There was a problem hiding this comment.
The second parameter appears redundant - passing row_count twice suggests the API might benefit from clearer parameter naming or documentation. Consider whether threads_request should match the iteration count or if this represents a threading hint that should be calculated differently.
| detail::threader_for(row_count, row_count, [&](std::int64_t i) -> void { | |
| const std::int64_t threads_request = detail::threader_get_max_threads(); | |
| detail::threader_for(row_count, threads_request, [&](std::int64_t i) -> void { |
| } | ||
|
|
||
| /// Pass a function to be executed in a for loop to the threading layer. | ||
| /// The maximal number of iterations in the loop is 2^31 - 1. |
There was a problem hiding this comment.
The documentation comment is now incorrect - it states the maximum is 2^31 - 1, but the function now accepts int64_t which allows up to 2^63 - 1 iterations. This comment should be updated to reflect the new 64-bit limit.
There was a problem hiding this comment.
Bot is right here.
| @@ -266,34 +265,13 @@ inline void threader_func_break(int i, bool & needBreak, const void * a) | |||
| /// @param[in] reserved Parameter reserved for the future. Currently unused. | |||
There was a problem hiding this comment.
The parameter name 'reserved' in the documentation no longer accurately describes the second parameter, which is now 'threads_request' with a specific purpose. The documentation should be updated to reflect that this parameter controls the number of threads requested for parallel execution.
There was a problem hiding this comment.
There is a mismatch between the headers and the C++ files regarding the names of the parameters.
There was a problem hiding this comment.
Actually, it's a common issue for all threader functions. WIll be update all of the functions
david-cortes-intel
left a comment
There was a problem hiding this comment.
Please address the issues from copilot.
|
I do not agree with Copilot that those changes are ABI breaking. So, changing the APIs/ABI of the threading layer cannot impact the end user. @Alexandr-Solovev , @david-cortes-intel what do you think? |
I think copilot took that from the description which states that it's ABI breaking due to removal of an exported function. |
@david-cortes-intel But this function is again removed from libonedal_thread.so library, which is not used directly by users. |
Then I guess @Alexandr-Solovev might want to edit the description. |
Description
ABI change: threader functions use 64-bit indices
This change updates the exported threading functions to use
int64_tinstead ofint/int32_t:_onedal_threader_for_daal_threader_forThe legacy helper
_onedal_threader_for_int64was removed since the implementation is now unified on 64-bit indices.Impact
This is an ABI-breaking change:
All downstream binaries must be rebuilt.
Release plan
This change is intended for the next major release, where ABI changes are allowed.
Checklist:
Completeness and readability
Testing
Performance