-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Usability of non-default CUDA streams, per-stream synchronization, memory safety guards #7348
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
base: main
Are you sure you want to change the base?
Changes from all commits
2edc51f
b1c178f
27d2ccc
bbfb696
f06bf67
3daa3cc
22da83e
271eb1e
8b4935c
3ca5175
2d05634
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,124 @@ namespace core { | |||||
|
|
||||||
| #ifdef BUILD_CUDA_MODULE | ||||||
|
|
||||||
| /// \enum CUDAMemoryCopyPolicy | ||||||
| /// | ||||||
| /// Specifier for different behavior of memory copies between the host and | ||||||
| /// device. | ||||||
| /// | ||||||
| enum class CUDAMemoryCopyPolicy { | ||||||
| // Default. | ||||||
| // Ensure all memory copy operations are finished by synchronizing the CUDA | ||||||
| // stream on which the copy occurred. | ||||||
| Sync = 0, | ||||||
| // Asynchronous memory copies. Unmanaged. | ||||||
| // No memory safety at all - you are responsible for your own actions. | ||||||
| // There are no guaranteed about the lifetime of memory copied between the | ||||||
|
||||||
| // There are no guaranteed about the lifetime of memory copied between the | |
| // There are no guarantees about the lifetime of memory copied between the |
Copilot
AI
Feb 23, 2026
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.
The example references CUDAMemoryCopyPolicy::AsyncUnmanaged, but the enum introduced in this PR defines Async (not AsyncUnmanaged). Since this is header documentation for a newly introduced API, it should compile conceptually and match the actual identifier to avoid confusing users. Update the example to use the correct enum value (or rename the enum value if AsyncUnmanaged is the intended public API spelling).
| /// CUDAStream::GetInstance().SetDeviceToHostMemcpyPolicy(CUDAMemoryCopyPolicy::AsyncUnmanaged); | |
| /// CUDAStream::GetInstance().SetDeviceToHostMemcpyPolicy(CUDAMemoryCopyPolicy::Async); |
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.
Several
cudaError_*enumerators here are not available in all CUDA toolkit versions/headers (Open3D often supports a range of CUDA versions). Unconditionally referencing newer error codes can break compilation for older CUDART versions. Consider guarding entries with#if CUDART_VERSION >= ...checks, or building this set from only broadly-available error codes (and treating unknown enums via runtime string matching / a fallback path).