Topic: [OpenCL] an error between clEnqueueMapImage and clEnqueueUnmapMemO

Help, I try to refine data flow rate in library https://github.com/amcelroy/OpenCLV changeover read/write on map/unmap. But permanently there is an error between clEnqueueMapImage and clEnqueueUnmapMemObject. Even if instead of memcpy I use a simple loop with assignment. Even if simply one byte I copy or I appropriate. A code piece where there is an error: size_t HostOrigin [3] = {0,0,0}; size_t Region [3] = {sizeof (unsigned int) *HostWidth, HostHeight, HostDepth}; void* map_ptr = clEnqueueMapImage (d-> GetQueue (), DeviceMem, CL_TRUE, CL_MAP_WRITE, HostOrigin, Region, &HostRowPitch, &HostSlicePitch, 0, NULL, NULL, NULL); memcpy (map_ptr, Data, HostWidth * HostHeight * sizeof (unsigned int));///ERROR???????????? *Error = clEnqueueUnmapMemObject (d-> GetQueue (), DeviceMem, map_ptr, 0, NULL, NULL); buffer Creation: cl_mem temp = clCreateBuffer (d-> GetContext (), CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR, Size, NULL, Error); HostSlicePitch after clEnqueueMapImage! = 0 That I do not so?