Summary
While the behavior of the scalar API is aligned with C++ standard library implementations, the instantiations of the oneDPL's RNG engines with sycl::vec are not documented, which may lead to a misuse by users.
Details
One of the misuse examples is that the portion generation method in all random number engines returns a sycl::vec whose trailing elements at indices [__random_nums, N-1] contain uninitialized values. The affected public API:
result_type operator()(unsigned int __random_nums)
Additionally, when __random_nums == 0, the entire returned vector contains garbage. Reading such elements by users is undefined behavior.
It's required to extend the documentation of the engines and cover the expected usage of the sycl::vec API (accessing only the requested numbers).
Summary
While the behavior of the scalar API is aligned with C++ standard library implementations, the instantiations of the oneDPL's RNG engines with
sycl::vecare not documented, which may lead to a misuse by users.Details
One of the misuse examples is that the portion generation method in all random number engines returns a
sycl::vecwhose trailing elements at indices [__random_nums,N-1] contain uninitialized values. The affected public API:Additionally, when
__random_nums == 0, the entire returned vector contains garbage. Reading such elements by users is undefined behavior.It's required to extend the documentation of the engines and cover the expected usage of the
sycl::vecAPI (accessing only the requested numbers).