-
Notifications
You must be signed in to change notification settings - Fork 22
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
mkl_blas::scal instead of loop in backend rng_rayleigh #1049
Conversation
{ | ||
result1[i] *= scale; | ||
} | ||
event_out = mkl_blas::scal(DPNP_QUEUE, size, scale, result1, 1); |
There was a problem hiding this comment.
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}); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@LukichevaPolina Is it possible to exclude data copy in DPNPC_ptr_adapter now? |
No description provided.