0% found this document useful (0 votes)
63 views2 pages

Instruction CUDA C

This document provides an example of adding two matrices using threads where each thread adds one row and prints "correct" if the program runs correctly. It includes instructions to compile the code using nvcc and run the resulting matrixAdd executable.

Uploaded by

Mayank Ajugia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views2 pages

Instruction CUDA C

This document provides an example of adding two matrices using threads where each thread adds one row and prints "correct" if the program runs correctly. It includes instructions to compile the code using nvcc and run the resulting matrixAdd executable.

Uploaded by

Mayank Ajugia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Matrix Addition example

The example adds two matrices and produces result


Each thread adds one row of the matrix
Fill in the blanks with appropriate data
Search for TODO
If the program runs correctly, it will print correct
at the end.

NVIDIA Confidential

Compile and run


To compile use following invocation
nvcc MatrixAdd_ex.xu o matrixAdd

To run use
./matrixAdd

NVIDIA Confidential

You might also like