Skip to content

Commit

Permalink
Fill Q into empty array for njit
Browse files Browse the repository at this point in the history
  • Loading branch information
ramain committed Nov 8, 2023
1 parent 9d754f3 commit f750b4f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fdmt/cpu_fdmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,15 @@ def fdmt_iteration(self, src, dest, i):
maxDT = self.maxDT
num_threads = self.num_threads

fdmt_iter_par(fs, nchan, df, Q, src, dest, i, fmin, fmax, np.float32(maxDT), num_threads)
# Wrap Q in a numpy array, rather than list of lists
# Makes it compliant with numba
L = len(Q)
Qarr = np.empty( shape=(L, len(Q[0])), dtype=np.uint32 )
for i in range(L):
Qi = np.array(Q[i])
Qarr[i, :len(Qi)] = Qi

fdmt_iter_par(fs, nchan, df, Qarr, src, dest, i, fmin, fmax, np.float32(maxDT), num_threads)


def reset_ABQ(self):
Expand Down

0 comments on commit f750b4f

Please sign in to comment.