Big data add

Adding up big data

Description

This is a repeat of the intro to CUDA article. Here we focus on code listing rather than explanations.

Audience

You already know basic C. You have advanced skills such as malloc(). You are interested to learn how to work withe big data including using CUDA.

C - Big data add

We allocate big arrays, intialize them, and print them out:

File link: ./prog03/prog03.c

CUDA - Big data add

File link: ./prog04/prog04.cu

Extra note

Notice the printArr() function returns without error but does not actually print anything to our console. Execution printArr() on the cpu resulted in a segmentation fault.

The documentation mentions that you can call printf() from gpu functions/kernels. We will try to execute printf() from the gpu again in the future.