Add debug flag ForceExtendedBufferSize

Forces extended buffer size by adding pageSize specify by number when
debug flag is >=1 in:
- clCreateBuffer
- clCreateBufferWithProperties
- clCreateBufferWithPropertiesINTEL

Usage:
ForceExtendedBufferSize=2
size += (2 * pageSize)

Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2022-01-18 22:16:28 +00:00
committed by Compute-Runtime-Automation
parent ac39f424ce
commit b75f5d4c8b
4 changed files with 66 additions and 2 deletions

View File

@ -649,6 +649,10 @@ cl_mem CL_API_CALL clCreateBuffer(cl_context context,
size_t size,
void *hostPtr,
cl_int *errcodeRet) {
if (DebugManager.flags.ForceExtendedBufferSize.get() >= 1) {
size += (MemoryConstants::pageSize * DebugManager.flags.ForceExtendedBufferSize.get());
}
TRACING_ENTER(clCreateBuffer, &context, &flags, &size, &hostPtr, &errcodeRet);
DBG_LOG_INPUTS("cl_context", context,
"cl_mem_flags", flags,
@ -674,6 +678,10 @@ cl_mem CL_API_CALL clCreateBufferWithProperties(cl_context context,
size_t size,
void *hostPtr,
cl_int *errcodeRet) {
if (DebugManager.flags.ForceExtendedBufferSize.get() >= 1) {
size += (MemoryConstants::pageSize * DebugManager.flags.ForceExtendedBufferSize.get());
}
DBG_LOG_INPUTS("cl_context", context,
"cl_mem_properties", properties,
"cl_mem_flags", flags,
@ -697,6 +705,10 @@ cl_mem CL_API_CALL clCreateBufferWithPropertiesINTEL(cl_context context,
size_t size,
void *hostPtr,
cl_int *errcodeRet) {
if (DebugManager.flags.ForceExtendedBufferSize.get() >= 1) {
size += (MemoryConstants::pageSize * DebugManager.flags.ForceExtendedBufferSize.get());
}
DBG_LOG_INPUTS("cl_context", context,
"cl_mem_properties_intel", properties,
"cl_mem_flags", flags,