Code Monkey home page Code Monkey logo

Comments (4)

kylelutz avatar kylelutz commented on May 18, 2024

Sounds great! The sort_by_key() algorithm is definitely on my big TODO list (I just need to find some spare time). Can you let me know what key/value data types you would be using?

from compute.

georgevanvenrooij avatar georgevanvenrooij commented on May 18, 2024

My code implements object properties as multiple arrays of a single property (to allow efficient access on GPU's). The most common value data type would be an integer (32-bit) that would index the various property arrays.

Key types can be a variety of things. Some examples of cases that I have are:

Simple cases:

float - the simplest case
floatN - ND data, sort by a single coordinate only (selectable at run-time)

More complex:

float2 - 2D data, sort by X then Y
floatN - ND data, sort by multiple coordinates in a specified order (i.e. first X, then Z then Y)

Of course integer and double key types would be very nice to have as well. :-)

from compute.

kylelutz avatar kylelutz commented on May 18, 2024

Hi George,

I've added initial support for the sort_by_key() algorithm (commit is here 3389a5c). As of right now it's only implemented for the serial insertion sort back-end so it is quite slow. But for now you can try compiling it and sorting small sequences.

Thanks,
Kyle

from compute.

kylelutz avatar kylelutz commented on May 18, 2024

I've updated the sort_by_key() algorithm to use radix sort instead of insertion sort (see commit bae7432). Performance should now be much better.

from compute.

Related Issues (20)

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.