OpenCL-CTS icon indicating copy to clipboard operation
OpenCL-CTS copied to clipboard

enqueue an unmap command but not call anly blocking API may cause define behavior

Open lengleng1992 opened this issue 9 months ago • 2 comments

https://github.com/KhronosGroup/OpenCL-CTS/blob/bb604702a5c34e71697f306b693e812b288828c6/test_conformance/math_brute_force/unary_double.cpp#L307

After clFlush, the memory object processed by unmap(host command) may be released prematurely.

lengleng1992 avatar Mar 18 '25 11:03 lengleng1992

Hi, can you please describe the problem in more detail? Which memory object may be released prematurely? Thanks!

bashbaug avatar Mar 18 '25 14:03 bashbaug

Hi,We found that this case has a very low probability of Crashing. May be related to the following use case behavior

cl_int Test()
{
    ...

    clEnqueueMapBuffer(A); // Map buffer A,Blocking
    
    // Verify data
    
    clEnqueueUnmapBuffer(A);  //  Unmap buffer A,Non Blocking
    clFlush(); // flush unmap operation,but not wait it
    
    return CL_SUCCESS; 
    
    // buffer A can released after Test() return,but unmap may be not completed.
}

lengleng1992 avatar Mar 31 '25 09:03 lengleng1992