|
This application was written in a very short period of time and it was used to show
how GPGPU approach can be fast. The application allows to user load a specific still
image to perform various edge-detection filters on it. When a user load a still
image, it downsamples the images to 512x512 pixels. Then uploads the image to GPU
memory and waits for the user. The user can apply well-known edge-detection filters.
These are:
- Roberts' Cross
- Laplace
- Prewitt
- Sobel
- Scharr
When the user selects a filter, predefined GPU shading program is activated to perform
edge-detection. All computations are massively parallel. And it's extremely fast
against a well optimized CPU implementation. Here is a benchmark on a laptop which
has a GeForce 8600M GS graphics card:
|
Filter:
|
Sobel
|
|
Computation:
|
0.0090 ms (110993.6 FPS)
|
|
Displaying:
|
0.0529 ms (18914.4 FPS)
|
|
Downloading:
|
5.9982 ms (166.7 FPS)
|
As can be observed above, the main bottleneck is downloading the result image from
GPU memory. But, it's still enough fast. As a reference, CPU implementation of sobel
filter takes ~200ms on a Core2Duo 2.2GHz CPU (~30x slower).
To speed up downloading, OpenGL's FPO extension is planned to be used. It's very
robust solution for GPGPU applications and can speed-up downloading speed drastically.
(Note: if you can't see filtered images, in the another word, if you see the original
image after applying a filter, that means your graphics card does not support required
OpenGL extensions. It's highly recommended to test the application at least with
a GeForce 8XXX series graphics card. If you still have problems, you should ensure
to installed your graphics card driver properly).
|