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

Avoid closures for custom operators #404

Open
simonbyrne opened this issue Jun 30, 2020 · 5 comments · May be fixed by #405
Open

Avoid closures for custom operators #404

simonbyrne opened this issue Jun 30, 2020 · 5 comments · May be fixed by #405

Comments

@simonbyrne
Copy link
Member

To support custom operators for PowerPC and ARM, we will need to avoid using closures as these are not supported (JuliaLang/julia#34326 and JuliaLang/julia#32154). There might be performance advantages on other platforms as well.

We currently skip the relevant tests on these platforms (#353)

Some options:

  • convert Op(f, T=Any) to a generated function
  • write a macro that allows us to "declare" custom operator/type combinations, i.e.
    @Op f T
    would define a non-closure cfunction for Op(::typeof(f),::Type{T})
@sloede
Copy link
Member

sloede commented Apr 2, 2022

Is there any progress on this issue? I just ran into it on my ARM/M1 laptop and would like to help getting it fixed. Unfortunately, I do not have the necessary chops to go about this alone, but I would be willing to lend a hand, run tests on an M1 etc. if that would be useful.

@giordano
Copy link
Member

@simonbyrne
Copy link
Member Author

For non-closures, we could use the same approach used by @yuyichao here https://github.com/JuliaMath/GSL.jl/pull/132/files#diff-ed5863a4bdd6189a79314f8c6cb0d3acefa0fe9235e7df221e6686fedb9efc08R40-R48
There is a bit of an explanation on how it works here:
JuliaMath/GSL.jl#130 (comment)

@simonbyrne
Copy link
Member Author

Ah, I don't think that will work.

@vchuravy
Copy link
Member

#871 partially fixes this. Still doesn't support user closures, but supports generic functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants