Skip to content

Commit

Permalink
Implementing cunumeric.random.BitGenerator (nv-legate#254)
Browse files Browse the repository at this point in the history
* Implementing BitGenerator - GPU part - creation

* Plugging destroy

* skip ahead for GPU BitGenerator random_raw

* Refectoring test

* Piping done for BitGenerator.random_raw

* LGT-260 -- implemented random_raw for CUDA

* Implementing BitGenerator - GPU part - creation

* Plugging destroy

* skip ahead for GPU BitGenerator random_raw

* Refectoring test

* Piping done for BitGenerator.random_raw

* LGT-260 -- implemented random_raw for CUDA

* Updating pre-commit

* Adding Multi-GPU support

* Refactoring

* refactoring

* CPU support - issues remain on multi-cpu mapper

* Attempts to support multi-dimension

* Finalizing multi-cpu implementation of BitGenerator

* Repro behavior of BitGenerator

* Adding random in tests

* Fixes from code review - part 1

* use of logger

* Enums improvement

* More on code review

* code review

* Removing task in python destructor

* Using Shape

* Lazy destroy also at destroy

* Using create_buffer for temporary buffer creation

* Fixing bugs following merge

* Adding alternate lazy init implementation

* Adding force create and force destroy

* Removing constraint in mapper

* Updating test

* Fixing Eager code branch

* Updating license information and adding integer generator

* PR review

* Removing reference to removed omp file

* Changes from PR comments

* Adding generator.random implementation

* Adding generator.lognormal implementation

* Adding generator.normal implementation

* Adding generator.poisson implementation

* Refectoring randutil to allow host-only compilation without CUDA enabled

* Moving distributions to HOST only capable

* Minor refactoring to split compilation of further distributions

* Fixing openmp test failure

* Adding random.generator.exponential

* Adding random.generator.gumbel

* Splitting distributions in several files

* Actually applying the WAR

* Adding random.generator.laplace

* Adding random.generator.logistic

* Adding random.generator.pareto

* Adding random.generator.power

* Adding random.generator.rayleigh

* Adding random.generator.standard_cauchy

* Adding random.generatortriangular

* Adding random.generator.weibul

* Adding random.generator.bytes

* PR review

* PR review

* PR review

* PR review

* fixing glitch

* More work on PR

* Fixing CURANDAPI

* Moving logger symbol from .cu to .cc

* removing destroy
  • Loading branch information
fduguet-nv authored and jjwilke committed Jul 29, 2022
1 parent 4cba42b commit 68a4f48
Show file tree
Hide file tree
Showing 49 changed files with 5,431 additions and 1 deletion.
56 changes: 56 additions & 0 deletions cunumeric/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class CuNumericOpCode(IntEnum):
BINARY_OP = _cunumeric.CUNUMERIC_BINARY_OP
BINARY_RED = _cunumeric.CUNUMERIC_BINARY_RED
BINCOUNT = _cunumeric.CUNUMERIC_BINCOUNT
BITGENERATOR = _cunumeric.CUNUMERIC_BITGENERATOR
CHOOSE = _cunumeric.CUNUMERIC_CHOOSE
CONTRACT = _cunumeric.CUNUMERIC_CONTRACT
CONVERT = _cunumeric.CUNUMERIC_CONVERT
Expand Down Expand Up @@ -441,6 +442,61 @@ class CuNumericTunable(IntEnum):
HAS_NUMAMEM = _cunumeric.CUNUMERIC_TUNABLE_HAS_NUMAMEM


# Match these to BitGeneratorOperation in cunumeric_c.h
@unique
class BitGeneratorOperation(IntEnum):
CREATE = _cunumeric.CUNUMERIC_BITGENOP_CREATE
DESTROY = _cunumeric.CUNUMERIC_BITGENOP_DESTROY
RAND_RAW = _cunumeric.CUNUMERIC_BITGENOP_RAND_RAW
DISTRIBUTION = _cunumeric.CUNUMERIC_BITGENOP_DISTRIBUTION


# Match these to BitGeneratorType in cunumeric_c.h
@unique
class BitGeneratorType(IntEnum):
DEFAULT = _cunumeric.CUNUMERIC_BITGENTYPE_DEFAULT
XORWOW = _cunumeric.CUNUMERIC_BITGENTYPE_XORWOW
MRG32K3A = _cunumeric.CUNUMERIC_BITGENTYPE_MRG32K3A
MTGP32 = _cunumeric.CUNUMERIC_BITGENTYPE_MTGP32
MT19937 = _cunumeric.CUNUMERIC_BITGENTYPE_MT19937
PHILOX4_32_10 = _cunumeric.CUNUMERIC_BITGENTYPE_PHILOX4_32_10


# Match these to BitGeneratorDistribution in cunumeric_c.h
@unique
class BitGeneratorDistribution(IntEnum):
INTEGERS_32 = _cunumeric.CUNUMERIC_BITGENDIST_INTEGERS_32
INTEGERS_64 = _cunumeric.CUNUMERIC_BITGENDIST_INTEGERS_64
UNIFORM_32 = _cunumeric.CUNUMERIC_BITGENDIST_UNIFORM_32
UNIFORM_64 = _cunumeric.CUNUMERIC_BITGENDIST_UNIFORM_64
LOGNORMAL_32 = _cunumeric.CUNUMERIC_BITGENDIST_LOGNORMAL_32
LOGNORMAL_64 = _cunumeric.CUNUMERIC_BITGENDIST_LOGNORMAL_64
NORMAL_32 = _cunumeric.CUNUMERIC_BITGENDIST_NORMAL_32
NORMAL_64 = _cunumeric.CUNUMERIC_BITGENDIST_NORMAL_64
POISSON = _cunumeric.CUNUMERIC_BITGENDIST_POISSON
EXPONENTIAL_32 = _cunumeric.CUNUMERIC_BITGENDIST_EXPONENTIAL_32
EXPONENTIAL_64 = _cunumeric.CUNUMERIC_BITGENDIST_EXPONENTIAL_64
GUMBEL_32 = _cunumeric.CUNUMERIC_BITGENDIST_GUMBEL_32
GUMBEL_64 = _cunumeric.CUNUMERIC_BITGENDIST_GUMBEL_64
LAPLACE_32 = _cunumeric.CUNUMERIC_BITGENDIST_LAPLACE_32
LAPLACE_64 = _cunumeric.CUNUMERIC_BITGENDIST_LAPLACE_64
LOGISTIC_32 = _cunumeric.CUNUMERIC_BITGENDIST_LOGISTIC_32
LOGISTIC_64 = _cunumeric.CUNUMERIC_BITGENDIST_LOGISTIC_64
PARETO_32 = _cunumeric.CUNUMERIC_BITGENDIST_PARETO_32
PARETO_64 = _cunumeric.CUNUMERIC_BITGENDIST_PARETO_64
POWER_32 = _cunumeric.CUNUMERIC_BITGENDIST_POWER_32
POWER_64 = _cunumeric.CUNUMERIC_BITGENDIST_POWER_64
RAYLEIGH_32 = _cunumeric.CUNUMERIC_BITGENDIST_RAYLEIGH_32
RAYLEIGH_64 = _cunumeric.CUNUMERIC_BITGENDIST_RAYLEIGH_64
CAUCHY_32 = _cunumeric.CUNUMERIC_BITGENDIST_CAUCHY_32
CAUCHY_64 = _cunumeric.CUNUMERIC_BITGENDIST_CAUCHY_64
TRIANGULAR_32 = _cunumeric.CUNUMERIC_BITGENDIST_TRIANGULAR_32
TRIANGULAR_64 = _cunumeric.CUNUMERIC_BITGENDIST_TRIANGULAR_64
WEIBULL_32 = _cunumeric.CUNUMERIC_BITGENDIST_WEIBULL_32
WEIBULL_64 = _cunumeric.CUNUMERIC_BITGENDIST_WEIBULL_64
BYTES = _cunumeric.CUNUMERIC_BITGENDIST_BYTES


# Match these to fftType in fft_util.h
class FFTType:
def __init__(
Expand Down
Loading

0 comments on commit 68a4f48

Please sign in to comment.