KomputeProject / kompute

General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
http://kompute.cc/
Apache License 2.0
1.97k stars 151 forks source link

[performance bug] Fix Sequence::clear() #328

Closed Crydsch closed 1 year ago

Crydsch commented 1 year ago

Hey, I noticed a performance degradation over time when repeatedly calling Sequence::eval(..) or Sequence::evalAsync(..).

Both functions first clear the currently recorded operations by calling Sequence::clear(), then record and actually evaluate the new operation.

The problem is - Sequence::clear() never actually clears the operations. This leads to operations just adding up.

This PR simply adds the missing clear call. I guess this was just an oversight... I only noticed this problem only in a compute heavy, long running process.

axsaucedo commented 1 year ago

Great fix, thank you! Woudl be great to add a unit test for this if possible