@@ -174,7 +174,6 @@ MemAllocatorTy::MemPoolTy::MemPoolTy(MemAllocatorTy *_Allocator) {
174174 BucketStats.resize (1 , {0 , 0 });
175175 BucketParams.emplace_back (AllocMax, AllocUnit);
176176 ZeroInit = true ;
177- ZeroInitValue.resize (AllocUnit, 0 );
178177 DP (" Initialized zero-initialized reduction counter pool for "
179178 " device " DPxMOD " : AllocMin = %zu, AllocMax = %zu, PoolSizeMax = %zu\n " ,
180179 DPxPTR (Allocator->Device ), AllocMin, AllocMax, PoolSizeMax);
@@ -266,7 +265,7 @@ void *MemAllocatorTy::MemPoolTy::alloc(size_t Size, size_t &AllocSize) {
266265
267266 if (ZeroInit) {
268267 auto RC =
269- Allocator->enqueueMemCopy (Base, ZeroInitValue. data () , BlockSize);
268+ Allocator->enqueueMemSet (Base, 0 , BlockSize);
270269 if (RC != OFFLOAD_SUCCESS) {
271270 DP (" Failed to zero-initialize pool memory\n " );
272271 return nullptr ;
@@ -549,6 +548,10 @@ Error MemAllocatorTy::dealloc_locked(void *Ptr) {
549548 return Plugin::success ();
550549}
551550
551+ int32_t MemAllocatorTy::enqueueMemSet (void *Dst, int8_t Value, size_t Size) {
552+ return Device->enqueueMemFill (Dst, &Value, sizeof (int8_t ), Size);
553+ }
554+
552555int32_t MemAllocatorTy::enqueueMemCopy (void *Dst, const void *Src,
553556 size_t Size) {
554557 return Device->enqueueMemCopy (Dst, Src, Size);
0 commit comments