File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
samples/introduction/async_api/src Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -113,24 +113,8 @@ fn main() -> Result<(), cust::error::CudaError> {
113113 // Stream is synchronized as a safety measure
114114 stream. synchronize ( ) . expect ( "Stream couldn't synchronize!" ) ;
115115
116- // Events and buffers can be safely dropped now
117- match Event :: drop ( start_event) {
118- Ok ( ( ) ) => println ! ( "Successfully destroyed start_event" ) ,
119- Err ( ( cuda_error, _event) ) => {
120- println ! ( "Failed to destroy start_event: {:?}" , cuda_error) ;
121- }
122- }
123-
124- match Event :: drop ( stop_event) {
125- Ok ( ( ) ) => println ! ( "Successfully destroyed stop_event" ) ,
126- Err ( ( cuda_error, _event) ) => {
127- println ! ( "Failed to destroy stop_event: {:?}" , cuda_error) ;
128- }
129- }
130-
131- DeviceBuffer :: drop ( device_a) . expect ( "Couldn't drop device array!" ) ;
132- LockedBuffer :: drop ( host_a) . expect ( "Couldn't drop host array!" ) ;
133-
134116 println ! ( "test PASSED" ) ;
135117 Ok ( ( ) )
118+
119+ // The events and the memory buffers are automatically dropped here.
136120}
You can’t perform that action at this time.
0 commit comments