Giter Club home page Giter Club logo

Comments (4)

avanhatt avatar avanhatt commented on July 23, 2024

We currently fail on this kernel because the output is a scalar, so a workaround is to have the output be a 1-element array.

I can implement scalar outputs, but it doesn't seem particularly useful right now because we don't have any rewrite rules for horizontal vector operations (so the example kernels won't see any improvement). Is there a use case here where some more complicated, per-elements computations feed into a final horizontal accumulation?

from diospyros.

agent-lee avatar agent-lee commented on July 23, 2024

The particular function I have is inlined so it's possible that it may get called inside a loop. Though in general I don't know if this is a valid assumption. Do the multiple function subroutines get inlined into the dataflow graph before the dios compiler gets to processing it? If so then maybe we're ok and I'll just wrap it with a loop.

from diospyros.

avanhatt avatar avanhatt commented on July 23, 2024

Diospyros essentially inlines everything into the outermost function of what is passed in. So yes, if the calling context is a loop here, it would be more useful to pass the surrounding loop context, something like:

#define SIZE 8
void foo(float x_in, float y_in[3], float z_out) {
  float acc = 0.0f;
  for (int a = 0; a < 3; a++) {
    acc = acc + x_in * y_in[a];
  }
  z_out = acc;
}

void loop(..., float all_outs[SIZE]) {
    for (int a = 0; a < SIZE; a++) {
        all_outs[a] = foo(...);
    }
}

In that case, the inner function foo should not need the input/output parameters to be tagged, as long as the outer (later) function does have the tags.

from diospyros.

avanhatt avatar avanhatt commented on July 23, 2024

Better error message for now in 0ac745b

from diospyros.

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.