MCPcopy
hub / github.com/uber/aresdb / cleanUpDeviceStatus

Method cleanUpDeviceStatus

query/aql_processor.go:266–288  ·  view source on GitHub ↗

CleanUpDevice cleans up the device status including 1. clean up the device buffer for storing results. 2. clean up the cuda streams

()

Source from the content-addressed store, hash-verified

264// 1. clean up the device buffer for storing results.
265// 2. clean up the cuda streams
266func (qc *AQLQueryContext) cleanUpDeviceStatus() {
267 // clean up foreign table memory after query
268 for _, foreignTable := range qc.OOPK.foreignTables {
269 qc.cleanUpForeignTable(foreignTable)
270 }
271 qc.OOPK.foreignTables = nil
272
273 // release geo pointers
274 if qc.OOPK.geoIntersection != nil {
275 deviceFreeAndSetNil(&qc.OOPK.geoIntersection.shapeLatLongs)
276 }
277
278 // Destroy streams
279 cgoutils.DestroyCudaStream(qc.cudaStreams[0], qc.Device)
280 cgoutils.DestroyCudaStream(qc.cudaStreams[1], qc.Device)
281 qc.cudaStreams = [2]unsafe.Pointer{nil, nil}
282
283 // Clean up the device result buffers.
284 qc.OOPK.currentBatch.cleanupDeviceResultBuffers()
285
286 // Clean up timezone lookup buffer.
287 deviceFreeAndSetNil(&qc.OOPK.currentBatch.timezoneLookupD)
288}
289
290// clean up foreign table
291func (qc *AQLQueryContext) cleanUpForeignTable(table *foreignTable) {

Callers 2

ProcessQueryMethod · 0.95
ReleaseMethod · 0.95

Calls 4

cleanUpForeignTableMethod · 0.95
DestroyCudaStreamFunction · 0.92
deviceFreeAndSetNilFunction · 0.85

Tested by

no test coverage detected