Skip to content
40 changes: 17 additions & 23 deletions .github/workflows/ghaction.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: stdBLAS
name: build/test

on: [push, pull_request]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo

jobs:
osmatrix:
strategy:
# Don't cancel all other builds if one fails
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
# A full list of runners can be found here:
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners
os: [ubuntu-latest, macos-latest, windows-latest]
build-type: [RelWithDebInfo]
cxx-standard: [17,20]
# In theory, we would test on older compilers such as gcc 7.5, clang 9, and vs 2019
# They are not installed on the runners by default, leaving this as a TODO item for now.
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -24,38 +28,28 @@ jobs:
run: cmake -E make_directory mdspan-build stdblas-build

- name: Configure mdspan
working-directory: mdspan-build
run: cmake -S $GITHUB_WORKSPACE/mdspan-src -B $GITHUB_WORKSPACE/mdspan-build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install
run: cmake -S mdspan-src -B mdspan-build -DMDSPAN_CXX_STANDARD=${{matrix.cxx-standard}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_INSTALL_PREFIX=mdspan-install

- name: Build mdspan
working-directory: mdspan-build
run: cmake --build $GITHUB_WORKSPACE/mdspan-build -j 3
run: cmake --build mdspan-build -j 3

- name: Install mdspan
working-directory: mdspan-build
run: cmake --install $GITHUB_WORKSPACE/mdspan-build
run: cmake --install mdspan-build

- name: Check Out
- name: Check Out stdblas
uses: actions/checkout@v4
with:
path: stdblas-src

- name: Configure stdblas
shell: bash
working-directory: stdblas-build
run: cmake -S $GITHUB_WORKSPACE/stdblas-src -B $GITHUB_WORKSPACE/stdblas-build -Dmdspan_DIR=$GITHUB_WORKSPACE/mdspan-install/ -DLINALG_ENABLE_TESTS=On -DLINALG_ENABLE_EXAMPLES=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/stdblas-install
run: cmake -S stdblas-src -B stdblas-build -Dmdspan_DIR=mdspan-install -DLINALG_CXX_STANDARD=${{matrix.cxx-standard}} -DLINALG_ENABLE_TESTS=On -DLINALG_ENABLE_EXAMPLES=On -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_INSTALL_PREFIX=stdblas-install

- name: Build stdblas
working-directory: stdblas-build
shell: bash
run: cmake --build $GITHUB_WORKSPACE/stdblas-build -j 3
run: cmake --build stdblas-build -j 3

- name: Test stdblas
working-directory: stdblas-build
shell: bash
run: ctest --output-on-failure

- name: Install stdblas
working-directory: stdblas-build
shell: bash
run: cmake --install $GITHUB_WORKSPACE/stdblas-build
run: cmake --install stdblas-build
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ auto execpolicy_mapper(T) { return impl::inline_exec_t(); }
namespace impl {

// std::remove_cvref_t is a C++20 feature.
template<class T>
using remove_cvref_t =
#ifdef __cpp_lib_remove_cvref
std::remove_cvref_t<T>;
using std::remove_cvref_t;
#else
std::remove_const_t<std::remove_reference_t<decltype(policy)>>;
template<class T>
using remove_cvref_t = std::remove_const_t<std::remove_reference_t<T>>;
#endif

// This function is not to be specialized; that's why
Expand Down
6 changes: 1 addition & 5 deletions include/experimental/__p1673_bits/proxy_reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ class proxy_reference : proxy_reference_base {
P1673_PROXY_REFERENCE_ARITHMETIC_OPERATOR( / )

friend auto abs(const derived_type& x) {
if constexpr (std::is_unsigned_v<value_type>) {
return value_type(static_cast<const this_type&>(x));
} else {
return abs(value_type(static_cast<const this_type&>(x)));
}
return impl::abs_if_needed(value_type(static_cast<const this_type&>(x)));
}

friend auto real(const derived_type& x) {
Expand Down
11 changes: 8 additions & 3 deletions include/experimental/__p1673_bits/transposed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ class layout_transpose {
return nested_mapping_.required_span_size();
}

template<class IndexType0, class IndexType1>
requires(std::is_convertible_v<IndexType0, index_type> &&
std::is_convertible_v<IndexType1, index_type>)
MDSPAN_TEMPLATE_REQUIRES(
class IndexType0,
class IndexType1,
/* requires */ (
std::is_convertible_v<IndexType0, index_type> &&
std::is_convertible_v<IndexType1, index_type>
)
)
index_type operator() (IndexType0 i, IndexType1 j) const
{
return nested_mapping_(j, i);
Expand Down
8 changes: 4 additions & 4 deletions tests/native/transposed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ namespace {
}
}

template<size_t PaddingValue>
void test_transposed_layout_left_padded(auto runtime_padding_value)
template<size_t PaddingValue, class PaddingValueType>
void test_transposed_layout_left_padded(PaddingValueType runtime_padding_value)
{
auto test_one = [=] (auto in_exts, auto out_exts,
std::vector<char>& fake_storage)
Expand Down Expand Up @@ -248,8 +248,8 @@ namespace {
}
}

template<size_t PaddingValue>
void test_transposed_layout_right_padded(auto runtime_padding_value)
template<size_t PaddingValue, class PaddingValueType>
void test_transposed_layout_right_padded(PaddingValueType runtime_padding_value)
{
auto test_one = [=] (auto in_exts, auto out_exts,
std::vector<char>& fake_storage)
Expand Down
Loading