Skip to content

ENH: fptr for random.seed backend #516

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

Merged
merged 2 commits into from
Jan 23, 2021
Merged

Conversation

samir-nasibli
Copy link

Description

  • return a function pointer for random.seed backend function.
  • all this functionality checked by test_seed python tests (from tests/test_random.py).
  • additionally backend test for check.

@shssf shssf added the in progress Please do not merge. Work is in progress. label Jan 22, 2021
@samir-nasibli samir-nasibli requested a review from shssf January 22, 2021 17:34
@samir-nasibli samir-nasibli removed the in progress Please do not merge. Work is in progress. label Jan 22, 2021
@@ -100,6 +100,7 @@ ctypedef void(*fptr_dpnp_rng_standard_gamma_c_1out_t)(void *, double, size_t) ex
ctypedef void(*fptr_dpnp_rng_standard_normal_c_1out_t)(void *, size_t) except +
ctypedef void(*fptr_dpnp_rng_uniform_c_1out_t)(void *, long, long, size_t) except +
ctypedef void(*fptr_dpnp_rng_weibull_c_1out_t)(void *, double, size_t) except +
ctypedef void(*fptr_dpnp_srand_c_1out_t)(size_t) except +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ctypedef void(*fptr_dpnp_srand_c_1out_t)(size_t) except +
ctypedef void(*fptr_dpnp_rng_srand_c_1out_t)(size_t) except +

@@ -630,6 +630,7 @@ void func_map_init_random(func_map_t& fmap)
fmap[DPNPFuncName::DPNP_FN_RNG_UNIFORM][eft_INT][eft_INT] = {eft_INT, (void*)dpnp_rng_uniform_c<int>};

fmap[DPNPFuncName::DPNP_FN_RNG_WEIBULL][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_rng_weibull_c<double>};
fmap[DPNPFuncName::DPNP_FN_RNG_SRAND][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_srand_c};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmap[DPNPFuncName::DPNP_FN_RNG_SRAND][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_srand_c};
fmap[DPNPFuncName::DPNP_FN_RNG_SRAND][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_rng_srand_c};

@shssf
Copy link
Contributor

shssf commented Jan 23, 2021

Please rename dpnp_srand_c to dpnp_rng_srand_c and the same with dpnp_srand

@shssf shssf merged commit 1fa62ca into master Jan 23, 2021
@shssf shssf deleted the samir-nasibli/enh/seed_random branch January 23, 2021 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants