multiple device shared buffer

Discussion created by nou on Feb 17, 2011
Latest reply on Feb 24, 2011 by laobrasuca

i read specification Appendix A about shared buffers across multiple devices.

In the command-queue that wants to synchronize to the latest state of a memory object,
commands queued by the application must use the appropriate event objects that represent
commands that modify the state of the shared memory object as event objects to wait on.

it mean that it is absolutly necesery pass event from one queue to another? becuase in next sentence:

This is
to ensure that commands that use this shared memory object complete in the previous command-
queue before the memory objects are used by commands executing in this command-queue.

this is subtile different. it mean that i must ensure that modifing command end before any other command on other queue can start. it even confirm sentence in next paragraph.

so it will be consistent when i use for example clFinish() on all queues. will changes in buffers propagate to other devices after this synchronization?

or consider this scenario. i have many small buffer so i spread it on multiple devices and clEnqueueNDRange simulation kernel with each one as parameter.

then i clEnqueueMarker on all queues.

after that clEnqueueWaitForEvents() with all events returned from marker. so i achive multiple device global barrier.

then i must share boundary data between this buffers as they are in 2D grid.

and after that again global barrier and simulation step and so on.


with this i come across another problem. i test clCreateBuffer. i can create as many buffers which fit into host memory. and they are tranfered into device as they are necesary. but when they fill up device memory i can't enqueue kernel with another buffer. it return CL_OUT_OF_RESOURCES. so is there a way to free device memory for additional buffers. as they are proceded sequentialy. i have huge data set which does not fit into device memory but can be split into small chunks. but i don't want create and release devices or manage writes and reads from device manualy to swap chunks of data. i hope that this will manage OpenCL rutime automaticaly.