mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-23 20:12:03 +08:00
Add clEnqueueVerifyMemory API
Change-Id: I15a514b14b9efdaeb182c7abd98b8e236932d50f Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
cae49f35a9
commit
7e3884e22d
@@ -3325,8 +3325,8 @@ void *CL_API_CALL clGetExtensionFunctionAddress(const char *func_name) {
|
||||
RETURN_FUNC_PTR_IF_EXIST(clGetAcceleratorInfoINTEL);
|
||||
RETURN_FUNC_PTR_IF_EXIST(clRetainAcceleratorINTEL);
|
||||
RETURN_FUNC_PTR_IF_EXIST(clReleaseAcceleratorINTEL);
|
||||
|
||||
RETURN_FUNC_PTR_IF_EXIST(clCreateBufferWithPropertiesINTEL);
|
||||
RETURN_FUNC_PTR_IF_EXIST(clEnqueueVerifyMemory);
|
||||
|
||||
void *ret = sharingFactory.getExtensionFunctionAddress(func_name);
|
||||
if (ret != nullptr)
|
||||
@@ -4247,3 +4247,37 @@ cl_kernel CL_API_CALL clCloneKernel(cl_kernel sourceKernel,
|
||||
|
||||
return pClonedKernel;
|
||||
}
|
||||
|
||||
CL_API_ENTRY cl_int CL_API_CALL clEnqueueVerifyMemory(cl_command_queue commandQueue,
|
||||
const void *allocationPtr,
|
||||
const void *expectedData,
|
||||
size_t sizeOfComparison,
|
||||
cl_uint comparisonMode) {
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
API_ENTER(&retVal);
|
||||
DBG_LOG_INPUTS("commandQueue", commandQueue,
|
||||
"allocationPtr", allocationPtr,
|
||||
"expectedData", expectedData,
|
||||
"sizeOfComparison", sizeOfComparison,
|
||||
"comparisonMode", comparisonMode);
|
||||
|
||||
if (sizeOfComparison == 0 || expectedData == nullptr || allocationPtr == nullptr) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
CommandQueue *pCommandQueue = nullptr;
|
||||
retVal = validateObjects(WithCastToInternal(commandQueue, &pCommandQueue));
|
||||
if (retVal != CL_SUCCESS) {
|
||||
return retVal;
|
||||
}
|
||||
|
||||
auto &csr = pCommandQueue->getCommandStreamReceiver();
|
||||
if (csr.expectMemory(allocationPtr, expectedData, sizeOfComparison, comparisonMode)) {
|
||||
retVal = CL_SUCCESS;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
retVal = CL_INVALID_VALUE;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user