^How to use @par with jit decorator ? #284
Unanswered
MisterBourbaki
asked this question in
Q&A
Replies: 1 comment
-
@MisterBourbaki You don't need to import it. Example: import codon
@codon.jit(debug=True)
def is_prime_codon_par(n):
if n <= 1:
return False
_@par(schedule='dynamic', chunk_size=10000, num_threads=16)
for i in range(2, n):
if n % i == 0:
return False
return True
print(is_prime_codon_par(13)) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there !
First, thanks for this lovely project :) I'm trying to use it to speed up a few things (working on ML).
Mostly, I would like to use codon jit decorator inside large Python codebases. But it is not clear in the docs how to use the @Par decorator to use parallelism. It is written to use _@par, but how ? How should I import it in the Python code ?
Hope anyone will be able to help me on that :)
Beta Was this translation helpful? Give feedback.
All reactions