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 v2 #1572

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
866d834
Unskip most "extra" functions.
blueberry Jan 21, 2025
40c1992
Revert changes to openblas_nolapack
blueberry Jan 21, 2025
bf15833
Create openblas_full.java
blueberry Jan 21, 2025
3c8c6cb
Fix a missing curly brace and a semicolon.
blueberry Jan 21, 2025
3e2c13b
Fix missing imports in openblas_full
blueberry Jan 21, 2025
2bc0cde
openblass_full inherits openblas
blueberry Jan 21, 2025
bfec140
Inherit openblas_full from openblas (in JavaCPP properties)
blueberry Jan 22, 2025
bba80fe
Extract functionsToSkip()
blueberry Jan 22, 2025
254e90b
Override functionsToSkip() in openblas_full
blueberry Jan 22, 2025
bd4f0e2
Fix a missing paren.
blueberry Jan 22, 2025
b9fc395
Remove unused imports.
blueberry Jan 22, 2025
dec4fb3
Remove includes from openblas_full @Properties
blueberry Jan 22, 2025
46b7829
Add missing imports.
blueberry Jan 22, 2025
fd3c44a
Delete a stray curly brace.
blueberry Jan 22, 2025
5bf9915
Another day, another stray paren missed :)
blueberry Jan 22, 2025
80a8783
Re-include @Platform in openblas_full
blueberry Jan 23, 2025
968a37b
Update CHANGELOG.md and fix nits
saudet Jan 23, 2025
4cf6a08
Fix one last nit
saudet Jan 23, 2025
f65e4b4
* Add `openblas_full` class giving access to all of OpenBLAS (pull #…
blueberry Jan 24, 2025
f40dd6a
Try overriding the map method.
blueberry Jan 24, 2025
b5b52aa
Merge branch 'master' into master
blueberry Jan 24, 2025
86cadbd
Revert functionsToSkip() to functions in openblas_nolapack.
blueberry Jan 25, 2025
2485580
Update CHANGELOG.md and fix nits
saudet Jan 25, 2025
2ed4199
Fix openblas/presets/openblas_full.java
saudet Jan 27, 2025
2036734
Explicitly exclude failing LAPACK_ functions from openblas_full.
blueberry Jan 28, 2025
d5aff56
Fix typos.
blueberry Jan 28, 2025
2e134f2
Updae openblas/global/openblas_full.java
saudet Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Add `openblas_full` class giving access to all of OpenBLAS ([pull #1571](https://github.com/bytedeco/javacpp-presets/pull/1571))
* Introduce `macosx-arm64` builds for ARPACK-NG, CMINPACK, FFTW, GSL, TensorFlow Lite, ONNX, ONNX Runtime ([issue #1069](https://github.com/bytedeco/javacpp-presets/issues/1069))
* Upgrade presets for OpenCV 4.11.0, DNNL 3.6.2, CPython 3.13.1, NumPy 2.2.1, SciPy 1.15.1, LLVM 19.1.6, ONNX Runtime 1.20.1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.11: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.12-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.openblas.global;

Expand Down
102,836 changes: 102,836 additions & 0 deletions openblas/src/gen/java/org/bytedeco/openblas/global/openblas_full.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.5.11: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.5.12-SNAPSHOT: DO NOT EDIT THIS FILE

package org.bytedeco.openblas.global;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2025 Samuel Audet, Dragan Djuric
*
* Licensed either under the Apache License, Version 2.0, or (at your option)
* under the terms of the GNU General Public License as published by
* the Free Software Foundation (subject to the "Classpath" exception),
* either version 2, or any later version (collectively, the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.gnu.org/licenses/
* http://www.gnu.org/software/classpath/license.html
*
* or as provided in the LICENSE.txt file that accompanied this code.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.bytedeco.openblas.presets;

import org.bytedeco.javacpp.annotation.NoException;
import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.InfoMap;

/**
*
* @author Samuel Audet
* @author Dragan Djuric
*/
@Properties(inherit = openblas.class, global = "org.bytedeco.openblas.global.openblas_full", value = {
@Platform(
include = {"openblas_config.h", "cblas.h", "lapacke_config.h", "lapacke_mangling.h", "lapack.h", "lapacke.h", "lapacke_utils.h"})})
@NoException
public class openblas_full extends openblas {

@Override public void map(InfoMap infoMap) {
openblas_nolapack.mapCommon(infoMap);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class openblas_nolapack implements LoadEnabled, InfoMapper {
}
}

@Override public void map(InfoMap infoMap) {
static void mapCommon(InfoMap infoMap) {
infoMap.put(new Info("lapack.h", "lapacke.h").linePatterns(".*LAPACK_GLOBAL.*").skip())
.put(new Info("OPENBLAS_PTHREAD_CREATE_FUNC", "OPENBLAS_BUNDERSCORE", "OPENBLAS_FUNDERSCORE", "DOUBLE_DEFINED", "xdouble",
"FLOATRET", "OPENBLAS_CONST", "CBLAS_INDEX", "LAPACK_IFMT", "FORTRAN_STRLEN", "lapack_int", "lapack_logical").cppTypes().annotations())
Expand All @@ -127,10 +127,21 @@ public class openblas_nolapack implements LoadEnabled, InfoMapper {
"defined(LAPACK_COMPLEX_CPP)", "LAPACK_COMPLEX_CUSTOM", "LAPACK_FORTRAN_STRLEN_END").define())
.put(new Info("openblas_complex_float", "lapack_complex_float").cast().pointerTypes("FloatPointer", "FloatBuffer", "float[]"))
.put(new Info("openblas_complex_double", "lapack_complex_double").cast().pointerTypes("DoublePointer", "DoubleBuffer", "double[]"));
}

@Override public void map(InfoMap infoMap) {
mapCommon(infoMap);
for (String f : functionsToSkip()) {
infoMap.put(new Info(f, "LAPACK_" + f, "LAPACK_" + f + "_base", "LAPACKE_" + f, "LAPACKE_" + f + "_work").skip());
}
}

public String[] functionsToSkip() {
saudet marked this conversation as resolved.
Show resolved Hide resolved
String[] functions = {
// not available in Accelerate
"cblas_caxpby", "cblas_daxpby", "cblas_saxpby", "cblas_zaxpby", "cblas_caxpyc", "cblas_zaxpyc",

"cblas_caxpby", "cblas_daxpby", "cblas_saxpby", "cblas_zaxpby",
"cblas_caxpyc", "cblas_zaxpyc",
"cblas_sgemmt", "cblas_dgemmt", "cblas_cgemmt", "cblas_zgemmt",
"cblas_cgemm_batch", "cblas_dgemm_batch", "cblas_sgemm_batch", "cblas_zgemm_batch",
"cblas_samax", "cblas_damax", "cblas_scamax", "cblas_dzamax",
Expand Down Expand Up @@ -162,9 +173,7 @@ public class openblas_nolapack implements LoadEnabled, InfoMapper {
"cgbrfsx", "cporfsx", "dgerfsx", "sgbrfsx", "ssyrfsx", "zherfsx", "cgerfsx", "csyrfsx", "dporfsx", "sgerfsx", "zgbrfsx", "zporfsx",
"cherfsx", "dgbrfsx", "dsyrfsx", "sporfsx", "zgerfsx", "zsyrfsx", "cgbsvxx", "cposvxx", "dgesvxx", "sgbsvxx", "ssysvxx", "zhesvxx",
"cgesvxx", "csysvxx", "dposvxx", "sgesvxx", "zgbsvxx", "zposvxx", "chesvxx", "dgbsvxx", "dsysvxx", "sposvxx", "zgesvxx", "zsysvxx"};
for (String f : functions) {
infoMap.put(new Info(f, "LAPACK_" + f, "LAPACK_" + f + "_base", "LAPACKE_" + f, "LAPACKE_" + f + "_work").skip());
}
return functions;
}

static int maxThreads = -1;
Expand Down
Loading