Skip to content

Document sycl::vec API of all RNG engines supported by oneDPL #2633

@ElenaTyuleneva

Description

@ElenaTyuleneva

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions