P4 to Git Change 1315824 by asalmanp@asalmanp-opencl-stg on 2016/09/19 12:04:15

SWDEV-102417 - Forum [205433] : Memory leak with printf statement inside kernel code

	A memory leak can occur if a printf statement is inside the .cl source code but it is not used inside the __kernel code (e.g., a function inside .cl code that uses printf but never called by the __kernel). In this case compiler generates the printf metadata but printf is not used by the __kernel (i.e., the printf buffer is empty).

	To fix this issue, release the transfer buffer object before returning false in PrintfDbgHSA::output function.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/11394/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprintf.cpp#42 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.cpp#3 edit


[ROCm/clr commit: 0dd7a03954]
Этот коммит содержится в:
foreman
2016-09-19 12:13:23 -04:00
родитель 75f80ffbfb
Коммит 321fc0490a
2 изменённых файлов: 2 добавлений и 0 удалений
+1
Просмотреть файл
@@ -659,6 +659,7 @@ PrintfDbgHSA::output(
if (offsetSize == 0) {
LogError("\n The printf buffer is empty!");
dev().xferRead().release(gpu, *xferBufRead_);
return false;
}
+1
Просмотреть файл
@@ -652,6 +652,7 @@ PrintfDbgHSA::output(
if (offsetSize == 0) {
LogError("\n The printf buffer is empty!");
dev().xferRead().release(gpu, *xferBufRead_);
return false;
}