-
-
Notifications
You must be signed in to change notification settings - Fork 159
Internal: Remove _ for array lengths #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| cargo-publish-dry-run: | ||
| name: cargo-publish-dry-run | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: stable | ||
| override: true | ||
| - uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: publish | ||
| args: --dry-run -F cuda-13000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1161,7 +1161,7 @@ pub mod external_memory { | |
| handle: sys::CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1 { fd }, | ||
| size, | ||
| flags: 0, | ||
| reserved: [0; _], | ||
| reserved: [0; 16], | ||
| }; | ||
| sys::cuImportExternalMemory(external_memory.as_mut_ptr(), &handle_description).result()?; | ||
| Ok(external_memory.assume_init()) | ||
|
|
@@ -1227,7 +1227,7 @@ pub mod external_memory { | |
| offset, | ||
| size, | ||
| flags: 0, | ||
| reserved: [0; _], | ||
| reserved: [0; 16], | ||
|
Comment on lines
1229
to
+1230
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }; | ||
| sys::cuExternalMemoryGetMappedBuffer( | ||
| device_ptr.as_mut_ptr(), | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -944,7 +944,7 @@ pub mod external_memory { | |||||||||||
| size, | ||||||||||||
| flags: 0, | ||||||||||||
| #[cfg(feature = "cuda-13000")] | ||||||||||||
| reserved: [0; _], | ||||||||||||
| reserved: [0; 16], | ||||||||||||
|
Comment on lines
945
to
+947
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||||||||
| }; | ||||||||||||
| sys::cudaImportExternalMemory(external_memory.as_mut_ptr(), &handle_description) | ||||||||||||
| .result()?; | ||||||||||||
|
|
@@ -1013,7 +1013,7 @@ pub mod external_memory { | |||||||||||
| size, | ||||||||||||
| flags: 0, | ||||||||||||
| #[cfg(feature = "cuda-13000")] | ||||||||||||
| reserved: [0; _], | ||||||||||||
| reserved: [0; 16], | ||||||||||||
|
Comment on lines
1014
to
+1016
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the other changes, using
Suggested change
|
||||||||||||
| }; | ||||||||||||
| sys::cudaExternalMemoryGetMappedBuffer( | ||||||||||||
| device_ptr.as_mut_ptr(), | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While hardcoding
16fixes the build issue, it makes the code brittle. If thereservedfield inCUDA_EXTERNAL_MEMORY_HANDLE_DESCever changes size in a future CUDA version, this code will be incorrect. A more robust and idiomatic way to initialize the remaining fields is to use..Default::default(). This will correctly zero-initializeflagsandreservedand will adapt to future changes in the struct definition.