Add HIP_INIT_ALLOC to init allocated memory.

Этот коммит содержится в:
Ben Sander
2017-09-13 23:31:48 +00:00
родитель cc08b36647
Коммит cea80cd8b3
3 изменённых файлов: 10 добавлений и 2 удалений
+6
Просмотреть файл
@@ -119,6 +119,11 @@ void * allocAndSharePtr(const char *msg, size_t sizeBytes, ihipCtx_t *ctx, bool
tprintf(DB_MEM, " alloc %s ptr:%p-%p size:%zu on dev:%d\n",
msg, ptr, static_cast<char*>(ptr)+sizeBytes, sizeBytes, device->_deviceId);
if (HIP_INIT_ALLOC != -1) {
// TODO , dont' call HIP API directly here:
hipMemset(ptr, HIP_INIT_ALLOC, sizeBytes);
}
if (ptr != nullptr) {
int r = sharePtr(ptr, ctx, shareWithAll, hipFlags);
if (r != 0) {
@@ -1180,6 +1185,7 @@ ihipMemsetKernel(hipStream_t stream,
}
// TODO-sync: function is async unless target is pinned host memory - then these are fully sync.
hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream )
{