Giter Club home page Giter Club logo

cuda_by_practice's Introduction

DOI

CUDA by practice

Introduction

This is an introduction to learn CUDA. I used a lot of references to learn the basics about CUDA, all of them are included at the end. There is a pdf file that contains the basic theory to start programming in CUDA, as well as a source code to practice the theory explained and its solution.


Details

####Description of the exercise

During the presentation, there are some examples and practices. For the examples, it is just necessary to do what is described in the Running the scripts section. For the practices, it is required to implement some sections of the code.

The _P and the _S in the scripts' name mean practice and solution respectively. Try to complete the practice and compare it with the solution at the end.

It is not necessary to create the source code from scratch, the file contains certain sections that need to be completed. The following example shows a line with the sentence **// -:YOUR CODE HERE:- **. This indicates that you have to complete the code just in that section avoiding removing the other parts of the code.

//Do the add vector operation
int* add(int *a, int *b, int *result, int N){

	// -:YOUR CODE HERE:-
}

####Running the scripts

NOTE: All the codes have been tested in linux environments. The command nvcc is used to compile CUDA source files, it is similar to the command gcc used to compile C source codes.

// The '$' indicates the prompt in the command window in linux.

//1. Compile. The flag '-o' is used to create a execution file with the name "exe", the name can be changed.
$ nvcc 00add_S.cu -o exe

//2. Execute. './' is used to execute the program in the current directory.
$./exe

//3. Result.
-: successful execution :-

Installation of CUDA


References

####Books

  • CUDA by Example: An Introduction to General-Purpose GPU Programming. Jason Sanders, Edward Kandrot
  • CUDA Application Design and Development. Rob Farber
  • CUDA Programming: A Developer's Guide to Parallel Computing with GPUs (Applications of GPU Computing Series). Shane Cook
  • Programming Massively Parallel Processors, Second Edition: A Hands- on Approach. David B. Kirk , Wen-mei W. Hwu

####Courses

  • Udacity: Introduction to Parallel Programming
  • Coursera: Heterogeneous Parallel Programming

####Websites


This document was last modified on : March. 7, 2017.

cuda_by_practice's People

Contributors

eegkno avatar keineahnung2345 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.