Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:

# The library must also configure, build and test on its own, with no engine
# around it: that is what lets it move to its own repository.
- name: Configure sparse_linalg standalone
- name: Configure sparsediff_linalg standalone
run: >
cmake -B build-standalone -S sparse_linalg
cmake -B build-standalone -S sparsediff_linalg
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
${{ runner.os == 'Windows' && '-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake' || '' }}

- name: Build sparse_linalg standalone
- name: Build sparsediff_linalg standalone
run: cmake --build build-standalone --config ${{ matrix.build_type }}

- name: Test sparse_linalg standalone
- name: Test sparsediff_linalg standalone
run: ctest --test-dir build-standalone -C ${{ matrix.build_type }} --output-on-failure
4 changes: 2 additions & 2 deletions .github/workflows/conda-forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ jobs:
run: |
readelf -d build/all_tests | grep NEEDED
readelf -d build/all_tests | grep -q 'libcblas\.so\.3'
readelf -d build/sparse_linalg/sparse_linalg_tests | grep NEEDED
readelf -d build/sparse_linalg/sparse_linalg_tests | grep -q 'libcblas\.so\.3'
readelf -d build/sparsediff_linalg/sparsediff_linalg_tests | grep NEEDED
readelf -d build/sparsediff_linalg/sparsediff_linalg_tests | grep -q 'libcblas\.so\.3'

- name: Re-run tests after switching to OpenBLAS (Linux)
if: runner.os == 'Linux'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/guard-malloc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
MallocScribble=1 MallocGuardEdges=1
leaks --atExit -- ./build/all_tests

- name: Run sparse_linalg tests under guard-malloc + leaks
- name: Run sparsediff_linalg tests under guard-malloc + leaks
run: >
MallocScribble=1 MallocGuardEdges=1
leaks --atExit -- ./build/sparse_linalg/sparse_linalg_tests
leaks --atExit -- ./build/sparsediff_linalg/sparsediff_linalg_tests
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Run tests
run: ./build/all_tests

- name: Run sparse_linalg tests
run: ./build/sparse_linalg/sparse_linalg_tests
- name: Run sparsediff_linalg tests
run: ./build/sparsediff_linalg/sparsediff_linalg_tests

# Create GitHub release after tests pass
release:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
- name: Run tests under ASan+UBSan
run: ./build/all_tests

- name: Run sparse_linalg tests under ASan+UBSan
run: ./build/sparse_linalg/sparse_linalg_tests
- name: Run sparsediff_linalg tests under ASan+UBSan
run: ./build/sparsediff_linalg/sparsediff_linalg_tests
4 changes: 2 additions & 2 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
--track-origins=yes -s --show-reachable=yes \
--error-exitcode=1 build/all_tests

- name: Run sparse_linalg tests under Valgrind
- name: Run sparsediff_linalg tests under Valgrind
run: |
valgrind --leak-check=full --show-leak-kinds=all \
--track-origins=yes -s --show-reachable=yes \
--error-exitcode=1 build/sparse_linalg/sparse_linalg_tests
--error-exitcode=1 build/sparsediff_linalg/sparsediff_linalg_tests

10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ option(SDE_WARNINGS_AS_ERRORS "Treat MSVC warnings as errors (/WX)"
# directory-scoped below this point (warnings, definitions) is engine-only: it
# reaches only subdirectories added after it.
if(SKBUILD)
set(SPARSE_LINALG_BUILD_TESTS OFF)
set(SPARSEDIFF_LINALG_BUILD_TESTS OFF)
else()
enable_testing()
endif()
set(SPARSE_LINALG_WARNINGS_AS_ERRORS ${SDE_WARNINGS_AS_ERRORS})
add_subdirectory(sparse_linalg)
set(SPARSEDIFF_LINALG_WARNINGS_AS_ERRORS ${SDE_WARNINGS_AS_ERRORS})
add_subdirectory(sparsediff_linalg)

add_compile_definitions(DIFF_ENGINE_VERSION="${DIFF_ENGINE_VERSION}")

Expand Down Expand Up @@ -87,14 +87,14 @@ function(sde_set_config_options target)
endfunction()

# Source files - automatically gather all .c files from src/ (the library lives
# under sparse_linalg/, outside this tree).
# under sparsediff_linalg/, outside this tree).
file(GLOB_RECURSE ENGINE_SOURCES "src/*.c")

# Differentiation engine (expression DAG, atoms, problem). Built
# position-independent so it can be linked into the Python extension module.
add_library(dnlp_diff ${ENGINE_SOURCES})
target_include_directories(dnlp_diff PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(dnlp_diff PUBLIC sparse_linalg::sparse_linalg)
target_link_libraries(dnlp_diff PUBLIC sparsediff_linalg::sparsediff_linalg)
set_property(TARGET dnlp_diff PROPERTY POSITION_INDEPENDENT_CODE ON)
sde_set_config_options(dnlp_diff)

Expand Down
2 changes: 1 addition & 1 deletion include/atoms/affine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define AFFINE_H

#include "expr.h"
#include "sparse_linalg/CSR_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"

expr *new_add(expr *left, expr *right);
expr *new_neg(expr *child);
Expand Down
2 changes: 1 addition & 1 deletion include/atoms/non_elementwise_full_dom.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define NON_ELEMENTWISE_FULL_DOM_H

#include "expr.h"
#include "sparse_linalg/CSR_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"
#include "subexpr.h"

/* quad-form with sparse constant matrix Q */
Expand Down
6 changes: 3 additions & 3 deletions include/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#ifndef EXPR_H
#define EXPR_H

#include "sparse_linalg/CSC_matrix.h"
#include "sparse_linalg/CSR_matrix.h"
#include "sparse_linalg/matrix.h"
#include "sparsediff_linalg/CSC_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"
#include "sparsediff_linalg/matrix.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion include/old-code/old_CSR.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef OLD_CSR_H
#define OLD_CSR_H

#include "sparse_linalg/CSR_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"

/* Build (I_p kron A) = blkdiag(A, A, ..., A) of size (p*A->m) x (p*A->n) */
CSR_matrix *block_diag_repeat_csr(const CSR_matrix *A, int p);
Expand Down
2 changes: 1 addition & 1 deletion include/old-code/old_CSR_sum.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef OLD_CSR_SUM_H
#define OLD_CSR_SUM_H

#include "sparse_linalg/CSR_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"

/* Compute C = A + B where A, B, C are CSR_matrix matrices
* A and B must have same dimensions
Expand Down
2 changes: 1 addition & 1 deletion include/old-code/old_affine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define OLD_AFFINE_H

#include "expr.h"
#include "sparse_linalg/CSR_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"

expr *new_linear(expr *u, const CSR_matrix *A, const double *b);

Expand Down
4 changes: 2 additions & 2 deletions include/old-code/old_permuted_dense.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef OLD_PERMUTED_DENSE_H
#define OLD_PERMUTED_DENSE_H

#include "sparse_linalg/CSR_matrix.h"
#include "sparse_linalg/permuted_dense.h"
#include "sparsediff_linalg/CSR_matrix.h"
#include "sparsediff_linalg/permuted_dense.h"

/* Legacy CSR-based (PD, Sparse) BTA / BTDA kernels.

Expand Down
4 changes: 2 additions & 2 deletions include/problem.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include "Timer.h"
#include "expr.h"
#include "sparse_linalg/COO_matrix.h"
#include "sparse_linalg/CSR_matrix.h"
#include "sparsediff_linalg/COO_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"
#include <stdbool.h>

typedef struct
Expand Down
6 changes: 3 additions & 3 deletions include/subexpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#define SUBEXPR_H

#include "expr.h"
#include "sparse_linalg/CSC_matrix.h"
#include "sparse_linalg/CSR_matrix.h"
#include "sparse_linalg/matrix.h"
#include "sparsediff_linalg/CSC_matrix.h"
#include "sparsediff_linalg/CSR_matrix.h"
#include "sparsediff_linalg/matrix.h"

/* Parameter ID for fixed constants (not updatable) */
#define PARAM_FIXED -1
Expand Down
Loading
Loading