Skip to content

Fix GPU expv! allocation in hermitian branch for Real t#200

Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:fix-gpu-allocation
Dec 16, 2025
Merged

Fix GPU expv! allocation in hermitian branch for Real t#200
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:fix-gpu-allocation

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

Fixes allocation in the GPU expv! hermitian branch for Real t by using lmul!(t, F.values) instead of t * F.values.

Changes:

  • For Real t: Uses lmul!(t, F.values) which modifies in place - non-allocating
  • For Complex t: Uses t * F.values - allocation is unavoidable since F.values is Real and multiplying by complex t requires type conversion

This also inlines the two GPU methods (previously shared an internal _expv_gpu_impl! function) since they now have different implementations in the hermitian branch.

Test plan

  • CI should pass all existing tests

🤖 Generated with Claude Code

Use lmul!(t, F.values) for Real t to avoid allocation in the hermitian
branch. For Complex t, allocation is unavoidable since F.values is Real
and multiplying by complex t requires type conversion.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit e6ffb6a into SciML:master Dec 16, 2025
18 of 28 checks passed
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.

2 participants