Skip to content

Commit

Permalink
adding numba numpy version of rambo
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshyoga committed Apr 6, 2023
1 parent 09dc9ed commit fd55bb3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions dpbench/benchmarks/rambo/rambo_numba_dpex_n.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

import dpnp as np
from numba_dpex import dpjit


@dpjit
def rambo(nevts, nout, C1, F1, Q1, output):
C = 2.0 * C1 - 1.0
S = np.sqrt(1 - np.square(C))
F = 2.0 * np.pi * F1
Q = -np.log(Q1)

output[:, :, 0] = Q
output[:, :, 1] = Q * S * np.sin(F)
output[:, :, 2] = Q * S * np.cos(F)
output[:, :, 3] = Q * C

0 comments on commit fd55bb3

Please sign in to comment.