You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the following code produces garbage values for s and idx:
from algorithm import parallelize
fn calc(s_: Int, h_: Int):
var s = 5000
var h = 100
@parameter
fn worker(y:Int):
idx = y * s
print(y, s, idx)
parallelize[worker](h,1)
def main():
calc(1000, 300)
Include relevant code snippet or link to code that did not work as expected.
If applicable, add screenshots to help explain the problem.
If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
Include anything else that might help us debug the issue.
System information
- What OS did you do install Mojo on ?
Ubuntu 24.04
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 24.5.0 (e8aacb95)
- Provide Modular CLI version by pasting the output of `modular -v`
magic 0.2.3
The text was updated successfully, but these errors were encountered:
Bug description
Calling the following code produces garbage values for
s
andidx
:like the following:
if I use
s_
within worker function - print produces expected result:I expect them to work in a similar way.
Steps to reproduce
System information
The text was updated successfully, but these errors were encountered: