Skip to content

Commit

Permalink
Add missing includes with the help of inshpect (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
gulivarese authored May 24, 2024
1 parent 99cfa87 commit 3db7fc8
Show file tree
Hide file tree
Showing 155 changed files with 548 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/inshpect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Inshpect

on:
pull_request:

jobs:
inshpect:
runs-on: ubuntu-24.04

steps:
- name: Install tools
run: |
sudo apt update
sudo apt install -y fd-find ripgrep dasel
pushd /tmp
curl --output inshpect \
--location https://raw.githubusercontent.com/msimberg/inshpect/d31ba8ed7e636c57cb9085ed3a8450d998e6b8a5/inshpect
echo "4b891a178fa99ac800b9b92acc0596d72f640ca1ae6de7f35ac4b3785dcd7af9 inshpect" | sha256sum --check
chmod +x inshpect
mv inshpect /usr/local/bin/inshpect
popd
- name: Checkout
uses: actions/checkout@v4
- name: Inshpect
if: always()
run: |
export INSHPECT_NUMTHREADS=4
export INSHPECT_FD=fdfind
inshpect . .inshpect.toml
176 changes: 176 additions & 0 deletions .inshpect.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
#
# Distributed Linear Algebra with Future (DLAF)
#
# Copyright (c) 2018-2023, ETH Zurich
# All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
#

extensions = ["c", "cpp", "cu", "h", "h.in"]

[includes]
enable = true
patterns = [
{ pattern = '\bstd::make_shared\b', include = 'memory' },
{ pattern = '\bstd::map\b', include = 'map' },
{ pattern = '\bstd::set\b', include = 'set' },
{ pattern = '\bstd::multi_map\b', include = 'multi_map' },
{ pattern = '\bstd::multi_set\b', include = 'multi_set' },
{ pattern = '\bstd::unordered_map\b', include = 'unordered_map' },
{ pattern = '\bstd::unordered_set\b', include = 'unordered_set' },
{ pattern = '\bstd::unordered_multi_map\b', include = 'unordered_map' },
{ pattern = '\bstd::unordered_multi_set\b', include = 'unordered_set' },
{ pattern = '\bstd::((shared|unique)_ptr)\b', include = 'memory' },
{ pattern = '\bstd::addressof\b', include = 'memory' },
{ pattern = '\bstd::list\b', include = 'list' },
{ pattern = '\bstd::string\b', include = 'string' },
{ pattern = '\bstd::vector\b', include = 'vector' },
{ pattern = '\bstd::array\b', include = 'array' },
{ pattern = '\bstd::reference_wrapper\b', include = 'functional' },
{ pattern = '\bstd::(c?ref)\b', include = 'functional' },
{ pattern = '\bstd::(u?int[0-9]+_t)\b', include = 'cstdint' },
{ pattern = '\bstd::((i|o)?stringstream)\b', include = 'sstream' },
{ pattern = '\bstd::((i|o)?fstream)\b', include = 'fstream' },
{ pattern = '\bstd::(cin|cout|cerr|clog)\b', include = 'iostream' },
{ pattern = '\bstd::setw\b', include = 'iomanip' },
{ pattern = '\bstd::setprecision\b', include = 'iomanip' },
{ pattern = '\bstd::size_t\b', include = 'cstddef' },
{ pattern = '\bstd::ptrdiff_t\b', include = 'cstddef' },
{ pattern = '\bstd::nullptr_t\b', include = 'cstddef' },
{ pattern = '\bstd::(true|false)_type\b', include = 'type_traits' },
{ pattern = '\bstd::(bool|integral)_constant\b', include = 'type_traits' },
{ pattern = '\bstd::invoke_result\b', include = 'type_traits' },
{ pattern = '\bstd::invoke_result_t\b', include = 'type_traits' },
{ pattern = '\bstd::is_void\b', include = 'type_traits' },
{ pattern = '\bstd::is_void_t\b', include = 'type_traits' },
{ pattern = '\bstd::is_null_pointer\b', include = 'type_traits' },
{ pattern = '\bstd::is_integral\b', include = 'type_traits' },
{ pattern = '\bstd::is_floating_point\b', include = 'type_traits' },
{ pattern = '\bstd::is_array\b', include = 'type_traits' },
{ pattern = '\bstd::is_enum\b', include = 'type_traits' },
{ pattern = '\bstd::is_union\b', include = 'type_traits' },
{ pattern = '\bstd::is_class\b', include = 'type_traits' },
{ pattern = '\bstd::is_function\b', include = 'type_traits' },
{ pattern = '\bstd::is_pointer\b', include = 'type_traits' },
{ pattern = '\bstd::is_lvalue_reference\b', include = 'type_traits' },
{ pattern = '\bstd::is_rvalue_reference\b', include = 'type_traits' },
{ pattern = '\bstd::is_member_object_pointer\b', include = 'type_traits' },
{ pattern = '\bstd::is_member_function_pointer\b', include = 'type_traits' },
{ pattern = '\bstd::is_fundamental\b', include = 'type_traits' },
{ pattern = '\bstd::is_arithmetic\b', include = 'type_traits' },
{ pattern = '\bstd::is_scalar\b', include = 'type_traits' },
{ pattern = '\bstd::is_object\b', include = 'type_traits' },
{ pattern = '\bstd::is_compound\b', include = 'type_traits' },
{ pattern = '\bstd::is_reference\b', include = 'type_traits' },
{ pattern = '\bstd::is_member_pointer\b', include = 'type_traits' },
{ pattern = '\bstd::is_const\b', include = 'type_traits' },
{ pattern = '\bstd::is_volatile\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivial\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_copyable\b', include = 'type_traits' },
{ pattern = '\bstd::is_standard_layout\b', include = 'type_traits' },
{ pattern = '\bstd::is_pod\b', include = 'type_traits' },
{ pattern = '\bstd::is_literal_type\b', include = 'type_traits' },
{ pattern = '\bstd::is_empty\b', include = 'type_traits' },
{ pattern = '\bstd::is_polymorphic\b', include = 'type_traits' },
{ pattern = '\bstd::is_abstract\b', include = 'type_traits' },
{ pattern = '\bstd::is_signed\b', include = 'type_traits' },
{ pattern = '\bstd::is_unsigned\b', include = 'type_traits' },
{ pattern = '\bstd::is_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_nothrow_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_default_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_default_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_nothrow_default_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_copy_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_copy_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_nothrow_copy_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_move_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_move_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_nothrow_move_constructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_nothrow_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_copy_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_copy_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_nothrow_copy_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_move_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_move_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_nothrow_move_assignable\b', include = 'type_traits' },
{ pattern = '\bstd::is_destructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_trivially_destructible\b', include = 'type_traits' },
{ pattern = '\bstd::is_same\b', include = 'type_traits' },
{ pattern = '\bstd::is_base_of\b', include = 'type_traits' },
{ pattern = '\bstd::is_convertible\b', include = 'type_traits' },
{ pattern = '\bstd::has_virtual_destructor\b', include = 'type_traits' },
{ pattern = '\bstd::alignment_of\b', include = 'type_traits' },
{ pattern = '\bstd::aligned_storage\b', include = 'type_traits' },
{ pattern = '\bstd::aligned_union\b', include = 'type_traits' },
{ pattern = '\bstd::rank\b', include = 'type_traits' },
{ pattern = '\bstd::extent\b', include = 'type_traits' },
{ pattern = '\bstd::add_(cv|const|pointer|volatile|lvalue_reference|rvalue_reference)\b', include = 'type_traits' },
{ pattern = '\bstd::make_signed\b', include = 'type_traits' },
{ pattern = '\bstd::make_unsigned\b', include = 'type_traits' },
{ pattern = '\bstd::remove_(cv|const|volatile|reference|pointer|extent|all_extents)\b', include = 'type_traits' },
{ pattern = '\bstd::decay\b', include = 'type_traits' },
{ pattern = '\bstd::enable_if\b', include = 'type_traits' },
{ pattern = '\bstd::conditional\b', include = 'type_traits' },
{ pattern = '\bstd::common_type\b', include = 'type_traits' },
{ pattern = '\bstd::underlying_type\b', include = 'type_traits' },
{ pattern = '\bstd::result_of\b', include = 'type_traits' },
{ pattern = '\bstd::is_invocable([a-z_]*)\b', include = 'type_traits' },
{ pattern = '\btypeid\b', include = 'typeinfo' },
{ pattern = '\bstd::type_info\b', include = 'typeinfo' },
{ pattern = '\bstd::(mem((set)|(cpy)|(move)))\b', include = 'cstring' },
{ pattern = '\bstd::swap\b', include = 'utility' },
{ pattern = '\bstd::move\b', include = 'utility' },
{ pattern = '\bstd::forward\b', include = 'utility' },
{ pattern = '\bstd::declval\b', include = 'utility' },
{ pattern = '\bstd::pair\b', include = 'utility' },
{ pattern = '\bstd::make_pair\b', include = 'utility' },
{ pattern = '\bstd::in_place\b', include = 'utility' },
{ pattern = '\bstd::exception_ptr\b', include = 'exception' },
{ pattern = '\bstd::terminate\b', include = 'exception' },
{ pattern = '\bstd::(s|g)et_terminate\b', include = 'exception' },
{ pattern = '\bstd::swap_ranges\b', include = 'algorithm' },
{ pattern = '\bstd::iter_swap\b', include = 'algorithm' },
{ pattern = '\bstd::atomic\b', include = 'atomic' },
{ pattern = '\bstd::(memory_order_[a-z_]+)\b', include = 'atomic' },
{ pattern = '\bstd::(minstd_rand(0)?)\b', include = 'random' },
{ pattern = '\bstd::(mt19937(_64)?)\b', include = 'random' },
{ pattern = '\bstd::random_device\b', include = 'random' },
{ pattern = '\bstd::uniform_(int|uniform)_distribution\b', include = 'random' },
{ pattern = '\bstd::apply\b', include = 'tuple' },
{ pattern = '\bstd::(forward_as_|make_|)tuple\b', include = 'tuple' },
{ pattern = '\bstd::ignore\b', include = 'tuple' },
{ pattern = '\bstd::tie\b', include = 'tuple' },
{ pattern = '\bstd::tuple_(cat|element|size)\b', include = 'tuple' },
{ pattern = '\bstd::(make_)optional\b', include = 'optional' },
{ pattern = '\bstd::nullopt\b', include = 'optional' },
{ pattern = '\bstd::any(|_cast)\b', include = 'any' },
{ pattern = '\bstd::error_(code|condition|category)\b', include = 'system_error' },
{ pattern = '\bstd::system_error\b', include = 'system_error' },
{ pattern = '\bstd::chrono\b', include = 'chrono' },
]

[copyright]
enable = false

[license]
enable = false

[spdx]
enable = false

[pragma_once]
enable = false

[deprecated_includes]
enable = false

[deprecated_names]
enable = false

[disallowed_macros]
enable = false
3 changes: 3 additions & 0 deletions include/dlaf/auxiliary/norm/mc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
//
#pragma once

#include <utility>
#include <vector>

#include <dlaf/auxiliary/norm/api.h>
#include <dlaf/common/range2d.h>
#include <dlaf/common/vector.h>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/blas/tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/// Provides `Tile` wrappers for BLAS operations.

#include <cstddef>
#include <utility>

#include <blas.hh>

Expand Down
2 changes: 2 additions & 0 deletions include/dlaf/common/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <utility>

#include <dlaf/common/source_location.h>

Expand Down
3 changes: 3 additions & 0 deletions include/dlaf/common/callable_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#pragma once

#include <utility>

/// @file

/// Given a function name @fname generates a constexpr object with name fname_o
Expand All @@ -23,6 +25,7 @@
/// The function name is wrapped in parentheses to disable ADL. It is assumed
/// that all required overloads are found relative to the namespace where the
/// macro is used.

#define DLAF_MAKE_CALLABLE_OBJECT(fname) \
constexpr struct fname##_t { \
template <typename... Ts> \
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/common/data_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#pragma once

#include <algorithm>
#include <cstddef>
#include <memory>
#include <type_traits>
#include <utility>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/common/index2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <ostream>
#include <string>
#include <type_traits>
#include <utility>

#include <dlaf/common/assert.h>
#include <dlaf/types.h>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/common/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

/// @file

#include <optional>
#include <utility>

#include <pika/async_rw_mutex.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/common/round_robin.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/// @file

#include <cstddef>
#include <vector>

#include <dlaf/common/assert.h>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/communication/broadcast_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/// @file

#include <type_traits>
#include <utility>

#include <pika/execution.hpp>

Expand Down
1 change: 1 addition & 0 deletions include/dlaf/communication/communicator_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#pragma once

#include <array>
#include <cstddef>

#include <dlaf/common/index2d.h>
#include <dlaf/communication/communicator.h>
Expand Down
2 changes: 2 additions & 0 deletions include/dlaf/communication/communicator_pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#pragma once

#include <utility>

#include <dlaf/common/index2d.h>
#include <dlaf/common/pipeline.h>
#include <dlaf/common/round_robin.h>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/communication/kernels/internal/all_reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once

#include <complex>
#include <functional>
#include <utility>

#include <mpi.h>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/communication/kernels/internal/broadcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once

#include <complex>
#include <functional>
#include <utility>

#include <mpi.h>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/communication/kernels/internal/p2p.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/// @file

#include <complex>
#include <functional>
#include <utility>

#include <mpi.h>
Expand Down
1 change: 1 addition & 0 deletions include/dlaf/communication/kernels/internal/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once

#include <complex>
#include <functional>
#include <utility>

#include <mpi.h>
Expand Down
2 changes: 2 additions & 0 deletions include/dlaf/communication/sync/basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/// @file

#include <utility>

#include <dlaf/common/data.h>
#include <dlaf/communication/communicator.h>
#include <dlaf/communication/error.h>
Expand Down
2 changes: 2 additions & 0 deletions include/dlaf/communication/sync/broadcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/// @file

#include <utility>

#include <dlaf/common/assert.h>
#include <dlaf/common/callable_object.h>
#include <dlaf/common/data.h>
Expand Down
4 changes: 4 additions & 0 deletions include/dlaf/eigensolver/band_to_tridiag/mc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
#pragma once

#include <atomic>
#include <cstddef>
#include <memory>
#include <sstream>
#include <utility>
#include <vector>

#include <pika/execution.hpp>
#include <pika/semaphore.hpp>
Expand Down
3 changes: 3 additions & 0 deletions include/dlaf/eigensolver/bt_band_to_tridiag/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

#pragma once

#include <cstddef>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

#include <pika/execution.hpp>
#include <pika/thread.hpp>
Expand Down
3 changes: 3 additions & 0 deletions include/dlaf/eigensolver/bt_reduction_to_band/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
//
#pragma once

#include <cstddef>
#include <utility>

#include <pika/execution.hpp>
#include <pika/thread.hpp>

Expand Down
Loading

0 comments on commit 3db7fc8

Please sign in to comment.