Code Monkey home page Code Monkey logo

Comments (7)

kylelutz avatar kylelutz commented on May 18, 2024

Boost.Compute has these algorithms implemented for OpenCL:

Let me know if you need help integrating them.

from arrayfire.

pavanky avatar pavanky commented on May 18, 2024

@kylelutz I think ArrayFire's behavior for set operations is slightly different from Boost.Compute. Let me have a look and see if they can be made compatible.

from arrayfire.

pavanky avatar pavanky commented on May 18, 2024

@kylelutz Do set_union and set_intersection require the inputs to be sorted ?

from arrayfire.

kylelutz avatar kylelutz commented on May 18, 2024

Yeah, they have the same behavior and requirements as the standard C++ algorithms (std::set_union() / std::set_intersection()).

from arrayfire.

pavanky avatar pavanky commented on May 18, 2024

@kylelutz All the set operations have two APIs like this:

AFAPI array setunique(const array& input);
AFAPI void setunique(array& values, array& indices, array& locations, const array& input);

ArrayFire does not expect the inputs to be sorted, so the input needs to be sorted internally. We can extend the API to include a default parameter bool isSorted=false. This way user can optionally turn off the internal sort.

For the first API we can use std (for CPU), thrust (for CUDA) and Boost.Compute (for OpenCL).
For the second API we can write the code using existing ArrayFire functions.

If you are interested in contributing code, I can create the skeleton and implement the CUDA and CPU backends and leave the OpenCL backend for you.

from arrayfire.

kylelutz avatar kylelutz commented on May 18, 2024

I'd be happy to! Probably won't be too much work.

from arrayfire.

pavanky avatar pavanky commented on May 18, 2024

@kylelutz I just pushed the skeleton and CPU implementation to the "set" branch. Let me know if you want to work on the OpenCL backend for these three functions.

from arrayfire.

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.