Code Monkey home page Code Monkey logo

cudatutorial's Introduction

CUDATutorial

A CUDA tutorial to make people learn CUDA program from 0

test enviroment

Turing T4 GPU

compile command

  1. compile by hand

nvcc xxx.cu -o xxx

if that does not work, pls try:

nvcc xxx.cu --gpu-architecture=compute_yy -o xxx

xxx is file name, yy is GPU compute capability, ep.A100's compute capability is 86.

  1. one-click compile and run

please ensure:

1.cmake version >= 3.8

2.you have CUDA TOOLKIT installed in system root directory, downloaded link is https://developer.nvidia.com/cuda-downloads.

 mkdir build 
 cd build 
 cmake .. && make -j8 
 cd bin 
 ./xxx

remark

  • related performance data is attached at the top of code file.
  • the performance data is diverse and diverse on different GPU platforms and NVCC compiler, so some counter-intuitive result is normal, we should only explore and debug the result.
  • welcome all comments and pull requests.

update notes

v2.0

  • add cuda stream
  • add quantize

v2.1

  • add fp32/fp16 gemv(vec * mat,mat is col major)

v2.2

  • add fp32/fp16 gemv(vec * mat,mat is row major)
  • add some code explaination(WIP)

cudatutorial's People

Contributors

russwong 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.