Hi - not sure this is strictly a metal issue, but I'm having problems with a memory leak.
When I create a buffer to use with the GPU, then bind the results so that I can access the data, the created buffer seems to stay in memory even once the variables intensityPointer and intensityBuff is no longer in scope.
I tried using deallocate, but this caused an error too.
Is there a standard way of managing such memory, or accessing the buffer in a different way which will allow the memory to be released when no longer used?
Thank you,
Colin
let intensityBuff = myGPUData.device?.makeBuffer(length: MemoryLayout<Float>.stride * Int(myStars.nstars * myStars.npatch * myStars.npatch, options: .storageModeShared)
let intensityPointer = intensityBuff?.contents().bindMemory(to: Float.self, capacity: MemoryLayout<Float>.stride * Int(myStars.nstars * myStars.npatch * myStars.npatch))