• Keine Ergebnisse gefunden

Assignment on Massively Parallel Algorithms - Sheet 3

N/A
N/A
Protected

Academic year: 2021

Aktie "Assignment on Massively Parallel Algorithms - Sheet 3"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Prof. G. Zachmann A. Srinivas

University of Bremen School of Computer Science

CGVR Group May 7, 2014

Summer Semester 2014

Assignment on Massively Parallel Algorithms - Sheet 3

Due Date 14. 05. 2014

Exercise 1 (Reverse Array (single block), 2 Credits)

Starting from thereverse_array_singletemplate, and given an input array{a0, a1, . . . , an−1} in pointer d_a, store the reversed array {an−1, an−2, . . . , a0} in pointer d_b. Launch only one thread block, to reverse an array of sizeN = numThreads = 256elements.

All you have to do is implement the body of the kernelreverseArrayBlock(). Each thread moves a single element to reversed position:

a) Read input from arrayd_a

b) Store output in reversed location in arrayd_b

Exercise 2 (Reverse Array (multiblock), 2 Credits)

Starting from thereverse_array_multi template, and given an input array {a0, a1, ...,an−1} in arrayd_a, store the reversed array {an−1, an−2, ..., a0} in array d_b. Launch multiple 256-thread blocks; to reverse an array of size N, you need N/256 blocks.

a) Compute the number of blocks to launch b) Implement the kernel reverseArrayBlock()

Exercise 3 (Fractals, 6 Credits )

Frameworkfractal_zoomerprovides a reference implementation of a Mandelbrot generator. To get the framework compiled and running, you need the freeglut library. For installation please see the slides from the first Tutorial.

a) Convert the reference implementation to a massively parallel GPU kernel and compare the results to the reference implementation. (You can (re-)use the source code from the lecture webpage, if you want). You only have to write the kernel functionfractal_gpu.

Compute the root mean square (RMS) error

ERM S = v u u u t

1 w·h

(w,h)

X

x=(0,0)

(ICP U(x)−IGP U(x))2 (1)

between the CPU and GPU implementation. What does the result mean?

Hint: You can switch between the CPU and GPU version by pressing the space key.

1

(2)

b) What happens when you zoom in very deeply? Examine a zoom in on the main antenna (Fig.1 arrow 1) that sticks out to the left, and another one into he upper antlers (Fig.1 arrow 2) growing out from the top of the main cardioid. Can you explain the different effects when you approach the limits of floating point precision?

Figure 1: Mandelbrot Points of Interest

c) Vary the block size of the kernel call, e.g. horizontal or vertical stripes, rectangles and squares of different sizes (use powers of two for simplicity). How does that influence running times?

2

Abbildung

Figure 1: Mandelbrot Points of Interest

Referenzen

ÄHNLICHE DOKUMENTE

This journey stalled in 1996 when the Court of Justice held that, as the treaties stood then, the European Community had no competence to accede to ECHR (opinion 2/94). In the wake of

Compared to older American jets, to say nothing of the latest Russian and Chinese fighter designs, the F-35 is looking worse and worse.. "Can't turn, can't climb, can't run,"

15 Appellate Body Report, European Communities and Certain Member States – Measures Affecting Trade in Large Civil Aircraft, WT/DS316/AB/R.. 16 Panel Report, European Communities

High Brightness Mode 1200 ANSI lumens (Color mode: Dynamic, Zoom: Wide, Lens Shift: Center) Low Brightness Mode 350 ANSI lumens (Color mode: Theatre Black, Zoom: Wide, Lens

In the Introduction we postulated that the sensitization to apo in pigeons does not arise from a non-associative sensitization process, but rather, that it is

The prima facie duty to reply, in such cases, will be reduced to the less demanding need to cite and positively note these papers in one’s routine work, if pertinent.. Relating

Anna Maria Coclite from the Institute of Solid State Physics, Christof Som- mitsch from the Institute of Material Sci- ence, Joining and Forming and Gregor.. Trimmel from

Figure 4: Temperature dependent conductivity, σ DC ∙T, of crystalline LiFePO 4 and biotemplated amorphous LiFePO4 as a function of the inverse temperature in an