Giter Club home page Giter Club logo

Comments (7)

wsmoses avatar wsmoses commented on June 26, 2024 1

C var-args passes things by value, so you need to & the args to make them pointers in that case: https://fwd.gymni.ch/zWsQwn

from enzyme.

wsmoses avatar wsmoses commented on June 26, 2024

from enzyme.

efeklisov avatar efeklisov commented on June 26, 2024

I hope I understood you correctly, but I see a similar issue

https://fwd.gymni.ch/TFoPoL

from enzyme.

wsmoses avatar wsmoses commented on June 26, 2024

Hopefully that solve your issue, however keeping this open for now so we can make the nice c++ syntax happy with it [and obviate the need for the extra work]: https://fwd.gymni.ch/UDe5lg

@samuelpmishLLNL @samuelpmish

from enzyme.

ipcamit avatar ipcamit commented on June 26, 2024

Sorry, I am having same issue, in a small example I was creating to ask unrelated question. Why is the minimal function below gives same error?

https://fwd.gymni.ch/NzHCYv

int __enzyme_const, __enzyme_dup;

void __enzyme_autodiffs(void (*) (double, double, double*), ...);

void math(double a, double b , double *result) {}

void grad(double a, double b, double *result, double *d_result) {

    double d_a = 0.0;
    double d_b = 0.0;
    __enzyme_autodiffs(math,
        __enzyme_dup, a, d_a,
        __enzyme_dup, b, d_b,
        __enzyme_dup, result, d_result);

}

from enzyme.

samuelpmish avatar samuelpmish commented on June 26, 2024

@ipcamit I think you're just using the wrong names for some of the enzyme stuff.

try:

  • __enzyme_autodiff rather than __enzyme_autodiffs
  • enzyme_const instead of __enzyme_const
  • enzyme_dup instead of __enzyme_dup

see: https://fwd.gymni.ch/k3qaoa

from enzyme.

ipcamit avatar ipcamit commented on June 26, 2024

This is embarrassing! I was using __enzyme_autodiff properly, and was trying to see if its name change will affect the compilation. But completely forgot about enzyme_dup, I was really sure that all things enzyme start like __enzyme...! Thank you for taking time to look into this.

from enzyme.

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.