Skip to content

compiler: Cast operands to long when calculating sizes for array allocation - #3042

Open
EdCaunt wants to merge 2 commits into
mainfrom
temp_alloc_cast
Open

EdCaunt wants to merge 2 commits into
mainfrom
temp_alloc_cast

Conversation

@EdCaunt

@EdCaunt EdCaunt commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@EdCaunt
EdCaunt requested review from FabioLuporini, JDBetteridge and mloubout and removed request for mloubout October 5, 2026 10:34
Comment thread devito/passes/iet/definitions.py Outdated
memptr = VOID(Byref(obj._C_symbol), '**')
alignment = obj._data_alignment
nbytes = SizeOf(obj._C_typedata)*as_long(obj.size)
size = prod(as_long(i) for i in obj.symbolic_shape)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like this could use a utility function (somewhere in symbolics.py?) , reusable across OSS and PRO?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand that change, as_long should already rebuild every arg of a Mul as long

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Didn't spot that - nice

@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.14%. Comparing base (66d6755) to head (e100bb6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3042      +/-   ##
==========================================
+ Coverage   84.13%   84.14%   +0.01%     
==========================================
  Files         258      258              
  Lines       56513    56526      +13     
  Branches     4825     4825              
==========================================
+ Hits        47547    47564      +17     
+ Misses       8140     8137       -3     
+ Partials      826      825       -1     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.62% <100.00%> (-0.01%) ⬇️
pytest-gpu-gcc- 78.87% <92.85%> (+0.03%) ⬆️
pytest-gpu-icx- 78.78% <92.85%> (-0.02%) ⬇️
pytest-gpu-nvc-nvidiaX 69.19% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EdCaunt
EdCaunt force-pushed the temp_alloc_cast branch 2 times, most recently from d581fee to 2c82d71 Compare October 5, 2026 11:28

This branch has not been deployed

No deployments
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.

3 participants