Skip to content

mkl_blas::scal instead of loop in backend rng_rayleigh #1049

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

Conversation

LukichevaPolina
Copy link
Contributor

No description provided.

{
result1[i] *= scale;
}
event_out = mkl_blas::scal(DPNP_QUEUE, size, scale, result1, 1);

Choose a reason for hiding this comment

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

@LukichevaPolina, please, if it is possible, try to use dependent events everywhere. Something like this:

    auto exponential_rng_event = mkl_rng::generate(distribution, DPNP_RNG_ENGINE, size, result1);
    auto sqrt_event = mkl_vm::sqrt(DPNP_QUEUE, size, result1, result1, {exponential_rng_event}, mkl_vm::mode::ha);
    auto blas_scal_event = mkl_blas::scal(DPNP_QUEUE, size, scale, result1, 1, {sqrt_event});
    blas_scal_event.wait();

event_out.wait();
auto exponential_rng_event = mkl_rng::generate(distribution, DPNP_RNG_ENGINE, size, result1);
auto sqrt_event = mkl_vm::sqrt(DPNP_QUEUE, size, result1, result1, {exponential_rng_event}, mkl_vm::mode::ha);
auto blas_event = mkl_blas::scal(DPNP_QUEUE, size, scale, result1, 1, {sqrt_event});
Copy link
Contributor

Choose a reason for hiding this comment

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

I would name variable scal_event.

Copy link
Contributor

@Alexander-Makaryev Alexander-Makaryev left a comment

Choose a reason for hiding this comment

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

LGTM

@Alexander-Makaryev
Copy link
Contributor

@LukichevaPolina Is it possible to exclude data copy in DPNPC_ptr_adapter now?

@Alexander-Makaryev Alexander-Makaryev merged commit e260298 into IntelPython:master Dec 30, 2021
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.

4 participants