Code Monkey home page Code Monkey logo

759-bignum's People

Contributors

ankursrvs avatar eyepatchparrot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

759-bignum's Issues

GPU Subtraction

The essence of subtraction is simply addition with a negation and a carry in.

However, manipulating the correct size of the output may not be trivial and ensuring that carries are handled correctly may also prove to be a challenge.

GPU Carries

11/24

Many potential optimizations available to GPUs not available to hardware due to no area overheads and warp scheduling improving performance. (Being able to eliminate a group of 32 threads could improve performance.)

http://www.cl.cam.ac.uk/research/srg/han/ACS-P35/8-bit-KoggeStone-Adder.pdf
p_i = A_i xor B_i
g_i = A_i and B_i
P_i:j = P_i:k+1 and P_k:j
G_i:j = G_i:k+1 or (P_i:k+1 and G_k:j)

S_i = p_i xor C_i-1

  1. Implement with 1 bit / thread exactly as prescribed.
  2. Consider vectorizing with 32 bits / thread. At 2048 threads / MP * 60 MPs * 32 additions / thread ~ 4 million additions to saturate = 15MB operands.
  3. Compare against using addition + cmp ops at various stages to see if acceleration is possible. Only try if addition is still slow.

Rather than doing an addition followed by carry, calculate all carry information and do carry adds, followed by an addition operation without carries.

What collisions are possible with byte-level carries?

Because we don't have block-wise carries at the addition stage, can't finalize any results. It might be worth it to spend memory to speculate on outcome given a block carry and given no block carry. I'm not sure that's any better than actually

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.