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

Enable non-standard OpenBLAS extensions #1571

Merged
merged 18 commits into from
Jan 24, 2025
Merged

Conversation

blueberry
Copy link
Contributor

This contribution enables the operations that are present in OpenBLAS, but might not be directly supported by Accelerate and/or MKL. The previous behavior is preserved, and the new openblas_full class added, which extends the openblas class and enables the "extra" operations.

We introduce openblas_full, as an alternative to openblas, and load the extra functions there.
openblas_full is an alternative to openblas that doesn't skip any function provided by openblas, except deprecated functions. It includes functions that are not present in Accelerate and/or MKL, but are included in OpenBLAS as an useful addition to the netlib BLAS interface.
... and just redefines map().
@blueberry
Copy link
Contributor Author

Is this ready to go now?

@saudet saudet merged commit f65e4b4 into bytedeco:master Jan 24, 2025
10 checks passed
@blueberry
Copy link
Contributor Author

It seems that the refactoring to functionsToSkip() did not work as intended.
(copypasta from the issue discussion)
Unfortunately, it seems that the final versions with functionsToSkip() did not work as intended. I've included the last SNAPSHOT in a project; the openblas_full class has been generated, but it does not contain any of the "extra" methods that we supposed to "unskip".

Looking at the code, Java-wise, I can't see why openblas_full is not getting an empty string array to skip, but JavaCPP-wise, there might be a gotcha.

Is this worth pursuing, or should we revert to the first solution that repeats some code? (but who knows, maybe the same gotcha is relevant there?)

BTW, the openblas_full class repeats the methods that are already in the openblas class. I'm not sure is that the JavaCPP generator is supposed to do that when properly configured (judging by the openblas_nolapack and openblas, it is not...).

@saudet
Copy link
Member

saudet commented Jan 24, 2025

Right, the InfoMap gets filled already via inherit...

@blueberry
Copy link
Contributor Author

So, if we just removed the inherit value in the annotation, the result will be that openblas_full reuses the Java code, while being configured from scratch, independently from openblas_nolapack and openblas? It won't mess up some fragile mechanism that's supposed to weed out repetitions, take care of overrides and such?

@saudet
Copy link
Member

saudet commented Jan 24, 2025

It's not as simple as that I'm sure, but someone has to try it. Do whatever it takes to make it work like you want it, that's fine!

@blueberry
Copy link
Contributor Author

Sure. Being a total noob, I would just like some pointers what would likely work, and what wouldn't, to avoid poking in the dark :)

@saudet
Copy link
Member

saudet commented Jan 24, 2025

Actually, there's already a pattern like that here where a static mapCommon() method does the trick:
https://github.com/bytedeco/javacpp-presets/tree/master/cminpack/src/gen/java/org/bytedeco/cminpack/global

@blueberry
Copy link
Contributor Author

Thanks. Will check it out and experiment (offline this time :)

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

Successfully merging this pull request may close these issues.

2 participants