Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extern codegen generates multiple function with the same name and different types #737

Open
yamaguchi1024 opened this issue Nov 5, 2024 · 0 comments
Labels
C: Codegen The final C code generation S: Available Available to be worked upon T: Bug Something isn't working

Comments

@yamaguchi1024
Copy link
Member

@proc
def foo_sigmoid(xo : f32, yo : f64, xi : f32, yi : f64):
    xo = sigmoid(xi)
    yo = sigmoid(yi)

generates a C file that starts with

#include <math.h>
double sigmoid(double x) {
    return 1 / (1 + exp(-x));
}

#include <math.h>
float sigmoid(float x) {
    return 1 / (1 + exp(-x));
}

which is invalid (C does not support function overloading).

@yamaguchi1024 yamaguchi1024 added the C: Codegen The final C code generation label Nov 5, 2024
@yamaguchi1024 yamaguchi1024 added T: Bug Something isn't working S: Available Available to be worked upon labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Codegen The final C code generation S: Available Available to be worked upon T: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant