mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
In constructor of CommandComputeKernel we had been doing multiple allocations of memory on heap due to lack of call to std::vector copy-constructor or reserve member function. Furthermore, in production code there is only one place, where we create objects of this type and we redundantly copy the local variable, which could be moved. This change: - ensures that constructor of CommandComputeKernel performs single allocation in the worst case; in the best case, it does not allocate memory due to usage of std::move on input parameter - steals the memory of the local variable in place of usage of the constructor to remove redundant copying and memory allocations - uses reserve() method to reduce the number of allocations during creation of this local variable Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
59 KiB
59 KiB