strange question

I want to do gauss blur to a lot of textures, so I use use a loop to handle every texture,
I used clCreateFromD3D10Texture2DKHR to contact one texture with one cl_mem, then copy every texture
to this texture, do gauss blur. Pseudo is as follows:
cl_mem g_src_mem=clCreateFromD3D10Texture2DKHR(context, 0, sharedTexture,…);
while()
{
StretchRect(texture, sharedTexture);
clEnqueueAcquireD3D10ObjectsKHR()
do gauss blur

}
something wrong with above Pseudo? whether synchronization is needed ? because StretchRect had not completed before opencl used this texture?

I would not recommend reusing the same texture object and using StretchRect. Instead, create a new CL texture object for each texture that you want to blur. That will save you a lot of bandwidth because you will avoid doing so many unnecessary copies. I think this would also avoid the sort of synchronization issues you are seeing.