Pre-allocate memory for 16K signals
On busy systems, the memory allocation can take long duration and increase calls to hsa_signal_create/hsa_amd_signal_create. This mitigates this issue. Change-Id: Ib7640273262ebc3dbf1f07049ce5da10b1d6b158
此提交包含在:
1 父節點
6ce1586def
當前提交
9a127193a8
1 file changed
+4
-1
@@ -157,10 +157,13 @@ static_assert((offsetof(SharedSignal, sdma_end_ts) % 32) == 0,
|
||||
static_assert(sizeof(SharedSignal) == 128,
|
||||
"Bad SharedSignal size.");
|
||||
|
||||
|
||||
#define SIGNAL_PREALLOC_BLOCKS 512 //16K Signals
|
||||
|
||||
/// @brief Pool class for SharedSignal suitable for use with Shared.
|
||||
class SharedSignalPool_t : private BaseShared {
|
||||
public:
|
||||
SharedSignalPool_t() : block_size_(minblock_) {}
|
||||
SharedSignalPool_t() : block_size_(SIGNAL_PREALLOC_BLOCKS * minblock_) {}
|
||||
~SharedSignalPool_t() { clear(); }
|
||||
|
||||
SharedSignal* alloc();
|
||||
|
||||
Reference in new issue
封鎖使用者