Old Final Exams
Final
Exam -
Spring 2010
In this final exam we
are going to take another look at optimizations under CUDA.
This final exam
is a 'take home' exam. You are expected to work on it completely
by
yourself. It is due Thursday May 6th
2010 at 11:59pm. By that time you
should have set up a web page with your solution, and emailed
the
location of that web page to Andy. During the scheduled final
exam time
we will meet in class and you will have 10 minutes to briefly
describe
your work to the class. We won't have time for a question /
answer
period; this way we can get through everyone within two hours.
The code we are
going to look at is the the Matrix
Transposition code from CUDA There
is a very
nice chapter on optimizing this code included with the CUDA
examples
and
available on the web here:
http://developer.download.nvidia.com/compute/cuda/3_0/sdk/website/CUDA/website/C/src/transposeNew/doc/MatrixTranspose.pdf
Your
job is to show how much of an affect those different
optimizations have
compared to a naive CUDA version of the algorithm with no
optimizations
on your card, or multiple cards if you chose.
The current code relies on square matrices with each side being
a
multiple of 32. You should relax this requirement in your code.
You
should also play with the thread size and thread orientation in
a block
to see what affect they have on the speed of the solution.
You can either code each of the versions in a single file or in
multiple files. Your
code should
be designed to run from the command line (though launching it
from a
bat file which contains a command line is fine). Your code
timing
should include the time to do the transpose, and the timing for
the
setup and readback. I would highly suggest setting up an
automated way
to do multiply runs with different parameters so you can gather
data
more efficiently.
Your grade will
be based on the number of optimizations that you evaluate and
the
quality of the web-based documentation for your testing. When
reading
through your web site someone new
to CUDA should get a better idea where they should focus their
energy
in optimizing their code.
Be sure to detail which GPU(s) you are using.
Final
Exam -
Spring 2008
In this final exam we
are going to take another look at optimizations under CUDA.
This final exam
is a 'take home' exam. You are expected to work on it completely
by
yourself. It is due Monday December 8th,
2008 at 11:59pm. By that time you
should have set up a web page with your solution, and emailed
the
location of that web page to Andy. During the scheduled final
exam time
we will meet in class and you will have 10 minutes to briefly
describe
your work to the class. We won't have time for a question /
answer
period; this way we can get through everyone within two hours.
The code we are
going to look at is the the convolution
code from CUDA. There is a very
nice paper on optimizing this code included with the CUDA
examples and
available on the web here:
http://developer.download.nvidia.com/compute/cuda/sdk/website/projects/convolutionSeparable/doc/convolutionSeparable.pdf
The CUDA
examples come with 3 convolution examples. The two important
ones here
are convolutionTexture and convolutionSeparable.
convolutionTexture has
some optimizations; convolutionSeparable has more optimizations.
Your
job is to show how much of an affect those different
optimizations have
compared to a naive CUDA version of the algorithm with no
optimizations.
Your code should
be designed to run from the command line (though launching it
from a
bat file which contains a command line is fine.) The code should
read
in a single image in raw format, apply a filter, and write out
the new
image in raw format. If it makes things easier you can make use
of
existing libraries to read in, and write out a standard format
(jpeg,
tiff, png, ppm, etc.) The time used to compare optimizations
should be
based on the time taken to do the image conversion, not on the
time
taken to read in and write out the image. In order to be able to
get
large enough values for comparison you may need to run the
convolution
kernels multiple times.
Your grade will
be based on the number of optimizations that you evaluate and
the
quality of the web-based documentation for your testing. You
should
start with a naive non-separated version, and then apply the
changes in
the paper (separating the horizontal and vertical work, using
shared
memory, reducing idle threads, coalescing memory access,
unrolling the
loops) or start from the optimized version and back-off those
optimizations in turn. When reading through your web site
someone new
to CUDA should get a better idea where they should focus their
energy
in optimizing their code.
Be sure to detail which graphics card you are using.
I've supplied a test image in multiple resolutions in both tif
and raw
rgb format in
ftp.evl.uic.edu/pub/INcoming/andy/525/hubble.tar.gz and is about
200 MB
This includes images in the following sizes to allow you to test
the
performance of the code on a variety of image sizes:
1024 x 1024
2048 x 2048
4096 x 4096
8192 x 8192
The original image is from
http://www.spacetelescope.org/goodies/posters/original/earth.tif
-----
The
tutorial is
due Monday December 8th at 11:59pm.
At the time of the final we will have two hours, and each person
will
give a brief 10 minute talk on their work.
Final
Exam -
Spring 2006
There's a
signpost up ahead ...
The final
exam
is a take home exam where you will write a tutorial. The
tutorial
should be in the form of a series of web pages similar to the
Lighthouse3D pages that we used in class.
The
tutorial
will take the student though the creation of a series of shaders
to
build a billboard (i.e. one of those big advertising signs that
you see
on the side of the highway or a smaller rectangular signboard
attached
to a post planted in the ground)
-----
the
billboard
can be a simple rectangular sign or fancier
the
billboard
can be static or have a moving part, or it could spin. If it
animates
in any way then that animation must be possible with a real
current
billboard.
in daylight
there is an image / text on the billboard
at night it
lights up or is lit up (LEDs, neon, light shining on it, flaming
torches, etc)
the content
of
the billboard is up to you
you can
place
the billboard in some location if you wish (in a field, on a
rooftop,
etc)
you can
type
'billboard' into the google image search and get a bunch of
ideas
-----
You should
go
through a series of steps in the tutorial to create the final
billboard
1 -
structure of
the billboard with daylight imagery
2 -
lighting for
nightime
3 -
something
fancy (motion, animation, more creative lighting)
4 - extras
- be
creative - show off
The code
must be
in GLSL and while there will obviously need to be some
supporting
OpenGL code, the shader code is what is important for your
grade. You
can use other people's algorithms but all of the code must be
yours.
Your web
page(s)
should include links to working code at the end of each stage,
and the
important sections of the code should be highlighted and
explained in
the web page. The idea here is that someone that already has
GLSL set
up on their computer should be able to go through this tutorial
and
learn more about what they can do with GLSL.
Implementing
the
basic stuff (1, 2) gets you a C. Implementing something fancy
gets you
a B, and doing some extra stuff gets you an A. But remember this
is
about explaining how you did what you did well, not just doing
it well.
The code
should
be able to run under windows/mac-os x/linux in EVL if I ask for
a demo
of it.
-----
The
tutorial is
due at the beginning of our final exam period.
At the time of the final we will have two hours, and each person
will
give a brief 8 minute talk on their tutorial.
last revision 12/12/11