Remove usages of Default on windows#471
Conversation
There was a problem hiding this comment.
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.
| }, | ||
| size, | ||
| ..Default::default() | ||
| flags: 0, |
There was a problem hiding this comment.
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],
Resolves #469