Skip to content

Remove usages of Default on windows#471

Merged
chelsea0x3b merged 1 commit into
mainfrom
fix-windows-default
Oct 29, 2025
Merged

Remove usages of Default on windows#471
chelsea0x3b merged 1 commit into
mainfrom
fix-windows-default

Conversation

@chelsea0x3b

Copy link
Copy Markdown
Owner

Resolves #469

@chelsea0x3b chelsea0x3b merged commit ffaa0a3 into main Oct 29, 2025
18 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request removes the usage of ..Default::default() for initializing CUDA handle description structs on Windows, replacing it with explicit field initialization. This is a good change for explicitness and safety, especially since the Default implementation might not be reliable across all platforms.

The change in src/driver/result.rs is correct. However, the change in src/runtime/result.rs is incomplete. It misses the conditional initialization of the reserved field for the cuda-13000 feature, which is present in the unix counterpart. I've added a critical comment to address this to prevent compilation errors.

Comment thread src/runtime/result.rs
},
size,
..Default::default()
flags: 0,

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.

critical

The reserved field is missing here. The unix version of this function, import_external_memory_opaque_fd, conditionally includes the reserved field for cuda-13000. To ensure consistency and prevent compilation errors when the cuda-13000 feature is enabled, you should also include the reserved field here under the same conditional compilation flag.

            flags: 0,
            #[cfg(feature = "cuda-13000")]
            reserved: [0; 16],

@chelsea0x3b chelsea0x3b deleted the fix-windows-default branch October 29, 2025 13:21
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.

Windows build broken since 0.17.4

1 participant