[Mesa-dev] EXTERNAL: Re: Clover clEnqueue* function don't implement blocking?
Dorrington, Albert
albert.dorrington at lmco.com
Mon Apr 14 14:09:38 PDT 2014
> -----Original Message-----
> From: Francisco Jerez [mailto:currojerez at riseup.net]
> Sent: Monday, April 14, 2014 4:04 PM
> To: Dorrington, Albert; mesa-dev at lists.freedesktop.org
> Subject: RE: EXTERNAL: Re: [Mesa-dev] Clover clEnqueue* function don't
> implement blocking?
>
> "Dorrington, Albert" <albert.dorrington at lmco.com> writes:
> >[...]
> > But when these events are queued, if there isn't a wait(), then what
> >triggers their flush from the queued_events list? That seems to only
> >happen when the hard_event::wait() is called (assuming the status is
> > queued)
> >
>
> Yes, that's right, or when clFlush() is called. So basically we only flush the
> queued commands to the hardware when the user does some blocking call
> like reading back a buffer object or waiting for an event explicitly.
>
> > Shouldn't something be flushing the queue as the events are processed
> > (especially if nothing is pending on the events), well before the
> > clFinish() call?
>
> I don't have any evidence that doing so would improve performance.
> Clover tries to minimize the frequency of flushes because it can be quite an
> expensive operation -- AFAIK for all hardware gallium drivers it involves at
> least one system call.
From reading the OpenCL spec (and perhaps I'm misinterpreting something again), section 5.10 Flush and Finish says:
Any blocking commands queued in a command-queue such as
clEnqueueRead{Image|Buffer} with blocking_read set to CL_TRUE,
clEnqueueWrite{Image|Buffer} with blocking_write set to CL_TRUE,
clEnqueueMap{Buffer|Image} with blocking_map set to CL_TRUE or
clWaitForEvents perform an implicit flush of the command-queue.
From this statement, I would expect that the command-queue would be flushed when the blocking flag is set.
More information about the mesa-dev
mailing list