Giter Site home page Giter Site logo

futhark-with-fangs's Introduction

Futhark with Fangs!

Futhark with Fangs is a small Python script that provides a web API to a Futhark program. You thought GPU performance was inhibited by PCI Express bandwidth? Just wait until you have tried tunneling all your data over HTTP!

Usage

Create an amazing Futhark program, say, futapp.fut:

entry dotprod (xs: []i32) (ys: []i32) = reduce (+) 0 (map2 (+) xs ys)

entry sumrows (xss: [][]i32) = map (reduce (+) 0) xss

Compile it to a Python module:

$ futhark pyopencl --library futapp.fut

Give it some fangs!

$ ./futhark_with_fangs.py futapp

Now go to another shell and POST some data with curl, or your favourite HTTP library in your favourite programming language:

$ echo '[1,2] [3,4]' | curl -X POST --data-binary @- localhost:8000/dotprod
10i32

If an error occurs, you will probably get an appropriate HTTP status code back (404 for missing entry point, 400 if you pass it bad data, 500 if it fails for some other reason).

Options

By default, futhark_with_fangs.py listens on port 8000 on localhost. Use --port and --host to change it.

Requirements

  • Python 3 (this is was 2018, people)
  • PyOpenCL
  • Numpy
  • Futhark 0.4.1 or newer.

If you are lucky, you can run pip3 install -r requirements.txt to get the Python dependencies.

futhark-with-fangs's People

Contributors

athas avatar

Stargazers

 avatar bb010g avatar Robin Voetter avatar Sabbir Ahmed avatar William K. avatar Brendan Zabarauskas avatar Andrew Prentice avatar Troels Bjørnskov avatar Slavfox avatar Adrien avatar Notas Hellout avatar Eric Ziegler avatar Julian Squires avatar Martin Elsman avatar Chris Pressey avatar Cathal Garvey avatar iTitou avatar Søren Sjørup avatar  avatar Niels G. W. Serup avatar

Watchers

Ken Friis Larsen avatar  avatar James Cloos avatar  avatar

Forkers

hermetique

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.