Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ce20cff
Setup calling BLAS/LAPACK subroutines directly. Modify "<-" handler t…
mns-nordicals Dec 30, 2025
0d7e6de
Copy old code to new branch
mns-nordicals Dec 30, 2025
6e44f93
Restore openmp feature - was overwritten with an older version of com…
mns-nordicals Dec 30, 2025
9a641e8
Renamed r2f-matrix as we need r2f_handlers enviroment
mns-nordicals Dec 30, 2025
a26f164
Properly restore openmp in compile function.
mns-nordicals Dec 30, 2025
807e370
Merge branch 'main' into feat/matrix_v3
mns-nordicals Dec 31, 2025
0e4c276
Use a more optimazed subroutine for single argument t/crossprod (syrk)
mns-nordicals Dec 31, 2025
296a9ce
Optimize transposed matrix multiplication such that t(A) %*% B is han…
mns-nordicals Dec 31, 2025
7feb91a
Improve on LLM written tests. Rename file to matrix-mul so we can hav…
mns-nordicals Dec 31, 2025
ca03587
Add outer() with only "*" and a valid option. Also added forward an …
mns-nordicals Jan 1, 2026
de37401
Code to reduce the number of temporary variable created - particularl…
mns-nordicals Jan 1, 2026
0aadc37
Try to simplify some code
mns-nordicals Jan 1, 2026
b09ab50
Fix bug in outer() and make subroutine safer by ensureing the dimensi…
mns-nordicals Jan 1, 2026
6d6ee0f
Add more xomplex test example
mns-nordicals Jan 1, 2026
3abdaf9
Add some developer documentation - can be moved/removed after PR revi…
mns-nordicals Jan 1, 2026
e18d2ed
Mostly for review, added a file with examples and generated code and …
mns-nordicals Jan 1, 2026
1dbdbab
Fix macOS failures?
mns-nordicals Jan 1, 2026
b9ed5a6
Fixes codex comment on assigning into an already existing variable an…
mns-nordicals Jan 2, 2026
4d15548
Reorganize code to hopefully increase readability.
mns-nordicals Jan 2, 2026
530a9d4
Fix OpenMP+BLAS linking on macOS
t-kalinowski Jan 2, 2026
fc46432
Fix Windows DLL path for OpenMP/BLAS
t-kalinowski Jan 2, 2026
c900cda
Expand Windows DLL search paths
t-kalinowski Jan 2, 2026
ce8c72b
Add coverage for Windows DLL path helper
t-kalinowski Jan 2, 2026
d7e34a8
Use R CMD config to find Windows toolchain bins
t-kalinowski Jan 2, 2026
b38cd1f
Use R.exe for R CMD config on Windows
t-kalinowski Jan 2, 2026
e1d87f7
Reduce heavy test workloads
t-kalinowski Jan 2, 2026
52e37f3
Fix windows
mns-nordicals Jan 2, 2026
74563df
Fix Windows BLAS/OpenMP loading
t-kalinowski Jan 2, 2026
d329509
Relax OpenMP timing on macOS
t-kalinowski Jan 3, 2026
6ebfab0
Add BLAS output coverage tests
t-kalinowski Jan 3, 2026
6e95a68
Cache OpenMP toolchain config
t-kalinowski Jan 3, 2026
0f63510
Add OpenMP diagnostics and matrix inference tests
t-kalinowski Jan 3, 2026
8fed7d8
Improve coverage for quick context and compiler paths
t-kalinowski Jan 3, 2026
0efebdd
Normalize Windows PATH assertions
t-kalinowski Jan 3, 2026
33d924b
Add BLAS vector crossprod coverage
t-kalinowski Jan 3, 2026
0c5940d
Add news entry
mns-nordicals Jan 3, 2026
714c023
Cover more BLAS matrix branches
t-kalinowski Jan 3, 2026
926cd57
Add matrix helper coverage tests
t-kalinowski Jan 3, 2026
4d9af22
Simplify R CMD config lookups
t-kalinowski Jan 5, 2026
2cfd64d
Fix R CMD config capture
t-kalinowski Jan 5, 2026
a497a3e
Fix recursive system2 default
t-kalinowski Jan 5, 2026
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
9 changes: 7 additions & 2 deletions R/compiler.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ quickr_fcompiler_env <- function(
quickr_env_is_true("QUICKR_PREFER_FLANG"),
write_lines = writeLines,
sysname = Sys.info()[["sysname"]],
use_openmp = FALSE
use_openmp = FALSE,
link_flags = character()
) {
stopifnot(is.character(build_dir), length(build_dir) == 1L, nzchar(build_dir))

use_openmp <- isTRUE(use_openmp)
link_flags <- link_flags[nzchar(link_flags)]

flang <- ""
flang_runtime <- character()
Expand Down Expand Up @@ -151,7 +153,10 @@ quickr_fcompiler_env <- function(
}
)
},
if (use_openmp) openmp_makevars_lines()
if (use_openmp) openmp_makevars_lines(),
if (length(link_flags)) {
paste("PKG_LIBS +=", paste(link_flags, collapse = " "))
}
)
write_lines(
makevars_lines,
Expand Down
3 changes: 3 additions & 0 deletions R/manifest.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ iso_c_binding_symbols <- function(
if (grepl("\\b[0-9]+_c_int\\b", body_code)) {
used_iso_bindings <- union(used_iso_bindings, "c_int")
}
if (grepl("\\bc_int\\b", body_code)) {
used_iso_bindings <- union(used_iso_bindings, "c_int")
}
if (grepl("\\b[0-9]+\\.[0-9]+_c_double\\b", body_code)) {
used_iso_bindings <- union(used_iso_bindings, "c_double")
}
Expand Down
88 changes: 61 additions & 27 deletions R/parallel.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ mark_openmp_used <- function(scope) {
invisible(root)
}

openmp_abort <- function(message, class = "quickr_openmp_error") {
stop(
structure(
list(message = message, call = sys.call(-1)),
class = c(class, "error", "condition")
)
)
}

is_parallel_decl_call <- function(e) {
is.call(e) &&
is.symbol(e[[1L]]) &&
Expand Down Expand Up @@ -126,26 +135,45 @@ openmp_directives <- function(parallel, private = NULL) {
)
}

openmp_config_value <- function(name) {
out <- tryCatch(
suppressWarnings(system2(
R.home("bin/R"),
c("CMD", "config", name),
stdout = TRUE,
stderr = TRUE
)),
error = function(e) character()
)
status <- attr(out, "status")
if (!is.null(status)) {
return("")
}
value <- trimws(paste(out, collapse = " "))
if (!nzchar(value) || grepl("^ERROR:", value)) {
return("")
openmp_config_value <- local({
cached <- NULL

function(name) {
if (is.null(cached)) {
cached <<- list()
}
cached_value <- cached[[name]]
if (!is.null(cached_value)) {
return(cached_value)
}

r_cmd <- R.home("bin/R")
if (identical(.Platform$OS.type, "windows") && !file.exists(r_cmd)) {
r_cmd <- paste0(r_cmd, ".exe")
}
out <- tryCatch(
suppressWarnings(system2(
r_cmd,
c("CMD", "config", name),
stdout = TRUE,
stderr = TRUE
)),
error = function(e) character()
)
status <- attr(out, "status")
if (!is.null(status)) {
cached[[name]] <<- ""
return("")
}
value <- trimws(paste(out, collapse = " "))
if (!nzchar(value) || grepl("^ERROR:", value)) {
cached[[name]] <<- ""
return("")
}
cached[[name]] <<- value
value
}
value
}
})

openmp_fflags <- function() {
env_flags <- trimws(Sys.getenv("QUICKR_OPENMP_FFLAGS", ""))
Expand Down Expand Up @@ -216,18 +244,24 @@ openmp_link_flags <- function(fflags = openmp_fflags()) {
openmp_makevars_lines <- function() {
fflags <- openmp_fflags()
if (!nzchar(fflags)) {
stop(
"OpenMP was requested but no OpenMP flags were found for this toolchain.",
"\nSet QUICKR_OPENMP_FFLAGS to your compiler's OpenMP flags.",
call. = FALSE
openmp_abort(
paste(
"OpenMP was requested but no OpenMP flags were found for this toolchain.",
"Set QUICKR_OPENMP_FFLAGS to your compiler's OpenMP flags.",
sep = "\n"
),
class = "quickr_openmp_unavailable"
)
}
libs <- openmp_link_flags(fflags = fflags)
if (!nzchar(libs)) {
stop(
"OpenMP was requested but no OpenMP linker flags were found.",
"\nSet QUICKR_OPENMP_LIBS to your linker OpenMP flags.",
call. = FALSE
openmp_abort(
paste(
"OpenMP was requested but no OpenMP linker flags were found.",
"Set QUICKR_OPENMP_LIBS to your linker OpenMP flags.",
sep = "\n"
),
class = "quickr_openmp_unavailable"
)
}
c(
Expand Down
Loading