Skip to content

Commit 6a4e02d

Browse files
committed
adding numba numpy version of rambo
1 parent 42ca2fd commit 6a4e02d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
import dpnp as np
6+
from numba_dpex import dpjit
7+
8+
9+
@dpjit
10+
def rambo(nevts, nout, C1, F1, Q1, output):
11+
C = 2.0 * C1 - 1.0
12+
S = np.sqrt(1 - np.square(C))
13+
F = 2.0 * np.pi * F1
14+
Q = -np.log(Q1)
15+
16+
output[:, :, 0] = Q
17+
output[:, :, 1] = Q * S * np.sin(F)
18+
output[:, :, 2] = Q * S * np.cos(F)
19+
output[:, :, 3] = Q * C

0 commit comments

Comments
 (0)