Re: CPU and GPU
- From: goodchild.trevor@xxxxxxxxx
- Date: 23 Dec 2005 21:06:05 -0800
>The set of SIMD instructions in pixel shader 3.0 looks very suitable to
>perform computations "inside" each memory block but combining of
>results from several blocks does not fit well to GPU and should be
>performed on CPU. So, pixel shader may be run several times per one
>computation session with CPU involvement between.
Actually, you should do whatever you can to keep data on the GPU -
there is almost never any benefit to reading back data to the CPU
because it's such a huge bottleneck.
Combining results from several computations on the GPU is referred to
as a "reduction" operation in GPGPU parlance. A reduction operation is
a process which combines results from multiple threads (fragments,
pixels, however you want to think about it) into a single result.
For instance, if you had a large texture of scalar values and wanted to
determine the average (mean) you might run a fragment shader which
averages four texels at a time, putting the result in a texture 1/2 the
size of the original. You would repeat this process until you reached
a texture of size 1x1, at which point you'd have your result. This
kind of scheme requires log(N) passes for an NxN texture, but there are
more clever schemes.
I'd suggest checking out the forums on http://www.gpgpu.org if you
haven't already - these folks should be more than willing to answer any
questions you have about the specifics.
- CPU and GPU
- From: stefanbanev
- CPU and GPU
- Prev by Date: CPU and GPU
- Next by Date: Re: CPU and GPU
- Previous by thread: CPU and GPU
- Next by thread: Re: CPU and GPU