Skip to content

Conversation

@BradLarson
Copy link
Collaborator

Building on the work started by @rajuptvs in PR #123, this converts all implicit Int <-> UInt conversions to explicit typecasts. This is important to migrate over now, because the latest Mojo and MAX nightlies make this a compilation error, rather than a warning. I tested each puzzle problem and solution, and with these casts each now works on the latest nightlies.

Where possible, I tried to have the casts take place in code that we provided to each person attempting to solve a problem, so that they didn't need to account for them in the code they'd write. I'm also trying to keep in mind that we may standardize on Int for many of these interfaces, so attempted to keep the code changes minimal for when that migration may occur.

Fixes #119

out_tensor,
a_tensor,
SIZE,
UInt(SIZE),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think would be easier to do it at the initialization alias SIZE: UInt = ....

):
global_i = block_dim.x * block_idx.x + thread_idx.x
local_i = thread_idx.x
global_i = Int(block_dim.x * block_idx.x + thread_idx.x)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to change this once we complete centralizing to Int.

Copy link
Collaborator

@ehsanmok ehsanmok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! A couple of minor points.

@ehsanmok ehsanmok removed the request for review from dunnoconnor November 17, 2025 17:28
@ehsanmok ehsanmok merged commit 84d4ad8 into modular:main Nov 17, 2025
2 checks passed
@BradLarson BradLarson deleted the uint-fix branch November 17, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deprecated warning for type conversion

2 participants