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
160 changes: 54 additions & 106 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Windows Rtools44
# Note that the workflows below use Powershell (pwsh) as they were originally written for Windows runners.
name: Rtools & ARM64 CI

on:
pull_request:
Expand All @@ -20,101 +21,28 @@ concurrency:

jobs:
prim-rev:
name: prim and rev tests
runs-on: windows-latest
name: ${{ matrix.config.label }} tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-24.04-arm]
config: [
{ label: misc, tests: 'test/unit/*_test.cpp test/unit/math/*_test.cpp test/unit/math/memory' },
{ label: prim, tests: 'test/unit/math/prim' },
{ label: rev, tests: 'test/unit/math/rev' },
{ label: fwd, tests: 'test/unit/math/fwd' },
{ label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/*_test.cpp' }
]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
rtools-version: '44'

- name: Set path for Rtools44
if: runner.os == 'Windows'
run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
run: |
make -f make/standalone math-libs -j2
- name: Add TBB to PATH
shell: powershell
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Run prim and rev unit tests
shell: powershell
run: |
python.exe runTests.py -j2 test/unit/*_test.cpp
python.exe runTests.py -j2 test/unit/math/*_test.cpp
python.exe runTests.py -j2 test/unit/math/prim
python.exe runTests.py -j2 test/unit/math/rev
python.exe runTests.py -j2 test/unit/math/memory

- name: Upload gtest_output xml
uses: actions/upload-artifact@v4
if: failure()
with:
name: gtest_outputs_xml
path: '**/*_test.xml'

fwd-non-fun-mix:
name: fwd tests and non-fun mix tests
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
rtools-version: '44'

- name: Set path for Rtools44
if: runner.os == 'Windows'
run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
run: |
make -f make/standalone math-libs -j2
- name: Add TBB to PATH
shell: powershell
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Disable running fwd/mix tests
shell: powershell
run: echo "CXXFLAGS+= -DSTAN_MATH_TESTS_REV_ONLY" | Out-File -Append -FilePath make/local -Encoding utf8
- name: Run fwd unit tests and all the mix tests except those in mix/fun
shell: powershell
run: |
python.exe runTests.py test/unit/math/fwd -j2
python.exe runTests.py test/unit/math/mix/core -j2
python.exe runTests.py test/unit/math/mix/functor -j2
python.exe runTests.py test/unit/math/mix/meta -j2
python.exe runTests.py test/unit/math/mix/prob -j2
python.exe runTests.py test/unit/math/mix/*_test.cpp -j2

- name: Upload gtest_output xml
uses: actions/upload-artifact@v4
if: failure()
with:
name: gtest_outputs_xml
path: '**/*_test.xml'

mix-fun-1:
name: mix/fun tests 1
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
rtools-version: '44'
Expand All @@ -124,19 +52,20 @@ jobs:
run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
shell: pwsh
run: |
Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
make -f make/standalone math-libs -j2

- name: Add TBB to PATH
shell: powershell
if: runner.os == 'Windows'
shell: pwsh
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Run mix/fun unit tests
shell: powershell

- name: Run ${{ matrix.config.label }} unit tests
shell: pwsh
run: |
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
$NumberTests = $MixFunTests.Length
$HalfNumberTests = [math]::Floor($NumberTests / 2)
python.exe runTests.py $MixFunTests[0..$HalfNumberTests]
python runTests.py -j4 ${{ matrix.config.tests }}

- name: Upload gtest_output xml
uses: actions/upload-artifact@v4
Expand All @@ -145,16 +74,23 @@ jobs:
name: gtest_outputs_xml
path: '**/*_test.xml'

mix-fun-2:
name: mix/fun tests 2
runs-on: windows-latest
mix-fun:
name: mix fun and prob tests ${{ matrix.group }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-24.04-arm]
group: [1, 2, 3, 4, 5]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'

- uses: r-lib/actions/setup-r@v2
if: runner.os == 'Windows'
with:
r-version: 'release'
rtools-version: '44'
Expand All @@ -164,20 +100,32 @@ jobs:
run: echo "C:/rtools44/usr/bin;C:/rtools44/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Build Math libs
shell: powershell
shell: pwsh
run: |
Add-Content make\local "O=1`n"
Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n"
make -f make/standalone math-libs -j2

- name: Add TBB to PATH
shell: powershell
if: runner.os == 'Windows'
shell: pwsh
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Run mix/fun unit tests
shell: powershell
shell: pwsh
run: |
$MixFunTests = Get-ChildItem -Path test\unit\math\mix\fun\* -Include *.cpp | Resolve-Path -Relative
$NumberTests = $MixFunTests.Length
$HalfNumberTests = [math]::Floor($NumberTests / 2)
python.exe runTests.py $MixFunTests[($HalfNumberTests + 1)..($NumberTests - 1)]
$MixFunProbTests = Get-ChildItem -Path test\unit\math\mix\fun\*, test\unit\math\mix\prob\* -Include *.cpp | Resolve-Path -Relative
$NumberTests = $MixFunProbTests.Length
$FifthNumberTests = [math]::Floor($NumberTests / 5)

$MixFunProbTestsArray = @( `
$MixFunProbTests[0..($FifthNumberTests - 1)], `
$MixFunProbTests[$FifthNumberTests..(2 * $FifthNumberTests - 1)], `
$MixFunProbTests[(2 * $FifthNumberTests)..(3 * $FifthNumberTests - 1)], `
$MixFunProbTests[(3 * $FifthNumberTests)..(4 * $FifthNumberTests - 1)], `
$MixFunProbTests[(4 * $FifthNumberTests)..($NumberTests - 1)] `
)

python runTests.py -j2 $MixFunProbTestsArray[(${{ matrix.group }} - 1)]

- name: Upload gtest_output xml
uses: actions/upload-artifact@v4
Expand Down
5 changes: 4 additions & 1 deletion stan/math/prim/fun/owens_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/functor/apply_scalar_binary.hpp>
#include <stan/math/prim/fun/boost_policy.hpp>
#include <boost/math/special_functions/owens_t.hpp>

namespace stan {
Expand Down Expand Up @@ -55,7 +56,9 @@ namespace math {
* @param a Second argument
* @return Owen's T function applied to the arguments.
*/
inline double owens_t(double h, double a) { return boost::math::owens_t(h, a); }
inline double owens_t(double h, double a) {
return boost::math::owens_t(h, a, boost_policy_t<>());
}

/**
* Enables the vectorized application of the owens_t
Expand Down