-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new function
openmp_enabled()
that informs the user if OpenMP is av…
…ailable or not.
- Loading branch information
1 parent
730cdc7
commit 6e12980
Showing
12 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Generated by cpp11: do not edit by hand | ||
|
||
has_openmp <- function() { | ||
.Call(`_fCWTr_has_openmp`) | ||
} | ||
|
||
fcwt_raw <- function(signal, fs, f0, f1, fn, sigma, nthreads, scaletype, optplans, abs) { | ||
.Call(`_fCWTr_fcwt_raw`, signal, fs, f0, f1, fn, sigma, nthreads, scaletype, optplans, abs) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
#' Check for OpenMP support | ||
#' | ||
#' This function checks if OpenMP support is enabled. It is responsible for | ||
#' the multithreading capabilities of [fcwt()]. If OpenMP is not enabled | ||
#' the parameter `n_threads` of [fcwt()] is ignored. | ||
#' | ||
#' @details | ||
#' OpenMP can be used by the underlying fCWT library if | ||
#' * the fftw library on your platform was compiled with OpenMP support and | ||
#' * the fCWTr package itself was compiled with OpenMP support. | ||
#' | ||
#' When using pre-built package binaries (like it is typical when you are using | ||
#' R on Windows), whether or not these conditions are met, depend on the (CRAN) | ||
#' build server. They cannot be influenced by the package author. | ||
#' | ||
#' If the user is building the R package yourself, the user needs to make sure | ||
#' that the fftw library on her platform are built with OpenMP support. | ||
#' The fCWTr package is configured to use OpenMP if fftw-OpenMP support is | ||
#' available. | ||
#' | ||
#' @return ( `TRUE` | `FALSE` ) | ||
#' Returns `TRUE` if OpenMP support is enabled, `FALSE` otherwise. | ||
#' | ||
#' @export | ||
openmp_enabled <- function() { | ||
has_openmp() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
test_that("openmp() works", { | ||
expect_true( | ||
openmp_enabled() == TRUE | openmp_enabled() == FALSE | ||
) | ||
}) |