Prof. G. Zachmann
Christoph Schr¨oder (schroeder.c@cs.uni-bremen.de)
University of Bremen School of Computer Science
CGVR Group September 14, 2020
Summer Semester 2020
Assignment on Massively Parallel Algorithms - Sheet 1
Due Date
Hint: You can use one of the examples on the lecture homepage or from the Cuda SDK ( included in the Cuda installation package ) to test if Cuda works at all on your computer. For example, you can run the example1_Utilities/deviceQuery.
Exercise 1 (CUDA basics: Memory, Credits)
In the frameworkcudaMallocAndMemcpy
a) Allocate two arraysd_aandd_bon the device of the same size as the arrayh_aon the host. You can usesizeof(datatype) to get the number of bytes fordatatype.
b) Copyh_aon the host tod_aon the device.
c) Do a device to device copy fromd_atod_b.
d) Copyd_bon the device back toh_aon the host.
e) Freed_aandd_bon the device.
1