Does queue->enqueueWriteBufferRect actually work?

I want to load load a rectangle to device memory.
One way to do it is to just use

error = queue->enqueueWriteBuffer(m_buffer, CL_TRUE, 0, sizeInBytes, sourceData);

but this requires to get the entire buffer from device, copy the rectangle to the desired
x, y host offset, and upload the buffer.

this is fine when the rectangle and the buffer are small and more or less similar size.
but when the buffer is really big (few gigabytes), the process is very time consuming,
I can’t use a kernel since the source is in host memory.
so I am considering enqueueWriteBufferRect

the function is the one below:

void ndBrainGpuBuffer::BrainMatrixToDevice(const ndBrainMatrix* const matrix)
{
	ndAssert(m_context->GetAsGpuContext());

#if 1
	std::array<size_t, 2> region;
	std::array<size_t, 2> host_offset;
	std::array<size_t, 2> buffer_offset;
		
	host_offset[0] = 0;
	host_offset[1] = 0;
	buffer_offset[0] = 0;
	buffer_offset[1] = 0;
	region[1] = size_t(matrix->GetRows());
	region[0] = size_t(matrix->GetColumns() * sizeof(ndReal));
	
	cl_int error = 0;
	ndSharedPtr<cl::CommandQueue>& queue = m_context->GetAsGpuContext()->m_queue;
	error = queue->enqueueWriteBufferRect(
		m_buffer, CL_TRUE,
		buffer_offset, host_offset, region,
		matrix->GetColumns() * sizeof(ndReal), 0,
		matrix->GetColumns() * sizeof(ndReal), 0,
		&matrix[0][0]);
	ndAssert(error == CL_SUCCESS);
#else

	ndBrainVector flatArray;
	//BrainVectorFromDevice(flatArray);
	for (ndInt32 i = 0; i < matrix->GetRows(); i ++)
	{
		for (ndInt32 j = 0; j < matrix->GetColumns(); j++)
		{
			flatArray.PushBack((*matrix)[i][j]);
		}
	}
	BrainVectorToDevice(flatArray);
#endif

	ndBrainVector xxx0;
	BrainVectorFromDevice(xxx0);
	//error *= 1;
}

however not mater what do, the function fail silently giving not error.
I have no found a single example of anyone using that function, in any google search.

can anyone provide an example of how to use enqueueWriteBufferRect .

edit:
it would be nice if some one actually reply,
It seem all my questions are ignored for some reason.
thanks,
Julio