From 3296e21fe269d3a4f6c02044283281feea415493 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 18 Jun 2024 17:26:53 -0400 Subject: [PATCH 1/6] Build in Debug mode --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 16dee840..92278fdf 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -3,7 +3,7 @@ name: CMake on: [push, pull_request] env: - BUILD_TYPE: RelWithDebInfo + BUILD_TYPE: Debug jobs: build-mdspan: From 02472bdea120dd22390f9016fa2cc316d8801749 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 18 Jun 2024 17:27:49 -0400 Subject: [PATCH 2/6] Enable warning flags in cmake.yml --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 92278fdf..ddcc410e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -68,7 +68,7 @@ jobs: - name: Configure CMake shell: bash working-directory: ${{github.workspace}}/mdspan-build - run: CXX=${{ matrix.compiler_prefix}}/${{ matrix.compiler_driver }} cmake $GITHUB_WORKSPACE/mdspan-src -DMDSPAN_CXX_STANDARD=${{ matrix.stdcxx }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install -DMDSPAN_ENABLE_TESTS=ON -DMDSPAN_ENABLE_EXAMPLES=ON -DMDSPAN_ENABLE_BENCHMARKS=${{matrix.enable_benchmark}} -DMDSPAN_ENABLE_COMP_BENCH=ON -DCMAKE_CXX_FLAGS=${{matrix.cxx_flags_extra}} + run: CXX=${{ matrix.compiler_prefix}}/${{ matrix.compiler_driver }} cmake $GITHUB_WORKSPACE/mdspan-src -DMDSPAN_CXX_STANDARD=${{ matrix.stdcxx }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install -DMDSPAN_ENABLE_TESTS=ON -DMDSPAN_ENABLE_EXAMPLES=ON -DMDSPAN_ENABLE_BENCHMARKS=${{matrix.enable_benchmark}} -DMDSPAN_ENABLE_COMP_BENCH=ON -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic ${{matrix.cxx_flags_extra}}" - name: Build shell: bash From d6e01e7221020a7422c5bbb6b08eef2d347bfb13 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 18 Jun 2024 17:28:50 -0400 Subject: [PATCH 3/6] Clean up cbench_submdspan.cpp.erb --- comp_bench/cbench_submdspan.cpp.erb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/comp_bench/cbench_submdspan.cpp.erb b/comp_bench/cbench_submdspan.cpp.erb index 7c894b28..e3e91427 100644 --- a/comp_bench/cbench_submdspan.cpp.erb +++ b/comp_bench/cbench_submdspan.cpp.erb @@ -3,11 +3,6 @@ int test(int* data) { #if defined(METABENCH) - auto sub0 = Kokkos::mdspan - > - >(data); <% (32/n).times do |k| %> auto <%= "sub0_#{k}" %> = Kokkos::mdspan <% end %> return 42 - <% (16/n).times do |k| %> + <% (32/n).times do |k| %> <%= " + sub#{n}_#{k}" %>() <% end %> ; + #else + (void) data; + return 1; #endif } From 52a98d5a79ae3f1eb619ea8cee1578d81dfa895a Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 18 Jun 2024 17:30:10 -0400 Subject: [PATCH 4/6] Fix semicolon in _MDSPAN_ALIGN_VALUE_ATTRIBUTE --- examples/aligned_accessor/aligned_accessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/aligned_accessor/aligned_accessor.cpp b/examples/aligned_accessor/aligned_accessor.cpp index 0f8518d3..cb54374f 100644 --- a/examples/aligned_accessor/aligned_accessor.cpp +++ b/examples/aligned_accessor/aligned_accessor.cpp @@ -72,13 +72,13 @@ using index_type = int; // Some compilers other than Clang or GCC like to define __clang__ or __GNUC__. // Thus, we order the tests from most to least specific. #if defined(__ICL) -# define _MDSPAN_ALIGN_VALUE_ATTRIBUTE( BYTE_ALIGNMENT ) __declspec(align_value( BYTE_ALIGNMENT )); +# define _MDSPAN_ALIGN_VALUE_ATTRIBUTE( BYTE_ALIGNMENT ) __declspec(align_value( BYTE_ALIGNMENT )) constexpr char align_attribute_method[] = "__declspec(align_value(BYTE_ALIGNMENT))"; #elif defined(__ICC) -# define _MDSPAN_ALIGN_VALUE_ATTRIBUTE( BYTE_ALIGNMENT ) __attribute__((align_value( BYTE_ALIGNMENT ))); +# define _MDSPAN_ALIGN_VALUE_ATTRIBUTE( BYTE_ALIGNMENT ) __attribute__((align_value( BYTE_ALIGNMENT ))) constexpr char align_attribute_method[] = "__attribute__((align_value(BYTE_ALIGNMENT)))"; #elif defined(__clang__) -# define _MDSPAN_ALIGN_VALUE_ATTRIBUTE( BYTE_ALIGNMENT ) __attribute__((align_value( BYTE_ALIGNMENT ))); +# define _MDSPAN_ALIGN_VALUE_ATTRIBUTE( BYTE_ALIGNMENT ) __attribute__((align_value( BYTE_ALIGNMENT ))) constexpr char align_attribute_method[] = "__attribute__((align_value(BYTE_ALIGNMENT)))"; #else # define _MDSPAN_ALIGN_VALUE_ATTRIBUTE( BYTE_ALIGNMENT ) From 888298fe3846e323652e6ab6fe311beb45cc3262 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 18 Jun 2024 17:31:17 -0400 Subject: [PATCH 5/6] Fix unusefd arguments --- include/experimental/__p0009_bits/macros.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/experimental/__p0009_bits/macros.hpp b/include/experimental/__p0009_bits/macros.hpp index f7b93744..b60c4261 100644 --- a/include/experimental/__p0009_bits/macros.hpp +++ b/include/experimental/__p0009_bits/macros.hpp @@ -642,7 +642,7 @@ __fold_left_assign_impl(Args&&... args) { template -constexpr __mdspan_enable_fold_comma __fold_comma_impl(Args&&... args) noexcept { return { }; } +constexpr __mdspan_enable_fold_comma __fold_comma_impl(Args&&...) noexcept { return { }; } template struct __bools; From 6243dd0dcbd44619ed9dae712adc515ca087847b Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 18 Jun 2024 17:34:37 -0400 Subject: [PATCH 6/6] Disable some harmless warnings --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ddcc410e..12dbe5aa 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -20,13 +20,13 @@ jobs: compiler_prefix: /usr/bin - compiler_driver: clang++ compiler_prefix: /usr/bin - cxx_flags_extra: "-stdlib=libc++" + cxx_flags_extra: "-stdlib=libc++ -Wno-c++17-attribute-extensions -Wno-gnu-zero-variadic-macro-arguments" - compiler_driver: icpx compiler_prefix: /opt/intel/oneapi/compiler/latest/linux/bin # To get new URL, look here: # https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#inpage-nav-6-undefined compiler_url: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ebf5d9aa-17a7-46a4-b5df-ace004227c0e/l_dpcpp-cpp-compiler_p_2023.2.1.8_offline.sh - cxx_flags_extra: "-DMDSPAN_USE_BRACKET_OPERATOR=0" + cxx_flags_extra: "-DMDSPAN_USE_BRACKET_OPERATOR=0 -Wno-c++17-attribute-extensions -Wno-gnu-zero-variadic-macro-arguments" - enable_benchmark: ON - stdcxx: 14 enable_benchmark: OFF