Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UINT Generation #695

Merged
merged 14 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions docs_input/api/random/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
Random Number Generation
########################

MatX provides the capability to generate random numbers on the host and device using the ``random()`` operator. ``random()``
uses cuRAND on the device to generate random numbers from device code.
MatX provides the capability to generate random numbers on the host and device using the ``random()`` and ``randomi()``
operators. both host and device generation is supported through the cuRAND library.


- ``random()`` only generates random distribution for *float* data types
- ``randomi()`` only generates random disitrubtions for *integral* data types

Please see the documentation for each function for a full list of supported types

Currently `random` only works on 32 and 64-bit floating point types for both real and complex.

.. note::
randomGenerator_t has been deprecated after release 0.5.0. Please use the ``random()`` operator instead

.. doxygenfunction:: matx::random(ShapeType &&s, Distribution_t dist, uint64_t seed = 0, LowerType alpha = 1, LowerType beta = 0)
.. doxygenfunction:: matx::random(const index_t (&s)[RANK], Distribution_t dist, uint64_t seed = 0, LowerType alpha = 1, LowerType beta = 0)
.. doxygenfunction:: matx::random(ShapeType &&s, Distribution_t dist, uint64_t seed = 0,LowerType alpha = 1, LowerType beta = 0)
.. doxygenfunction:: matx::random(const index_t (&s)[RANK], Distribution_t dist, uint64_t seed = 0,LowerType alpha = 1, LowerType beta = 0)
.. doxygenfunction:: matx::randomi(ShapeType &&s, uint64_t seed = 0, LowerType min = 0, LowerType max = 100)
.. doxygenfunction:: matx::randomi(const index_t (&s)[RANK], uint64_t seed = 0, LowerType min = 0, LowerType max = 100)

Examples
~~~~~~~~
Expand All @@ -22,3 +25,10 @@ Examples
:start-after: example-begin random-test-1
:end-before: example-end random-test-1
:dedent:


.. literalinclude:: ../../../test/00_tensor/ViewTests.cu
:language: cpp
:start-after: example-begin randomi-test-1
:end-before: example-end randomi-test-1
:dedent:
Loading