Giter Club home page Giter Club logo

pygpu's Introduction

PyGPU

Playing with GPU and python.

My working environment

  • Ubuntu 11.04
  • ATI 5470 graphic

Install

  1. Install the ATI driver under Linux.

  2. Install OpenCL dependencies

$ apt-get install freeglut3-dev python-numpy
  1. Install OpenCL, packages amd-app-2.4 and amd-app-dev. (last known link is http://forums.amd.com/forum/messageview.cfm?catid=390&threadid=125792&STARTPAGE=1&FTVAR_FORUMVIEWTMP=Linear)

  2. Do a dryrun of OpenCL

$ cat "#include <CL/opencl.h>" > testcl.c
$ gcc testcl.c -o prog -lOpenCL
  1. Download pyopencl. (last known link http://pypi.python.org/pypi/pyopencl)

  2. Unpack and install

$ python setup.py build
$ python setup.py install 

Structure

####Part 1##### Contains a code that sums 2 vectors using GPU.

####Part 2##### Finds the prime numbers until N.

(I know there are better algorithms than the one I have implemented, but the porpuse is to test the GPU.)

Benchmarks

####Vector Sum##### Execution time of test without OpenCL: 11.731222868 seconds

Execution time of test with OpenCL: 0.521452188492 seconds

####Prime numbers##### N=100

Execution time of test without OpenCL: 0.000123023986816 seconds

Execution time of test with OpenCL: 0.601119995117 seconds

N=1000

Execution time of test without OpenCL: 0.00573706626892 seconds

Execution time of test with OpenCL: 0.579922914505 seconds

N=10000

Execution time of test without OpenCL: 42.7467110157 seconds

Execution time of test with OpenCL: 5.0943210125 seconds

Notes

This code has not been updates since 2013 and it is less likely that will be again.

License

Copyright Stefan Fodor @ 2013

This program is free under the terms of GNU GPL licence.

Feel free to copy, modify and redistribute.

pygpu's People

Contributors

xtephan avatar

Stargazers

Laurence avatar Adam Griffiths avatar  avatar

Watchers

Laurence avatar  avatar 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.