Skip to content

Commit 2f300c2

Browse files
authored
Added Proper Include What You Use (CNugteren#627)
* Made all utilities and backend stuff available through the utilities/utilities.hpp header to avoid needless dozens of includes. * Removed timing.hpp from include because it used by tuners and diagnostics. * Added clblast_half.h into the utilities.hpp to be exported because it is a utility to interface with half. * Made the backend files not actually export themselves to prevent suggestions for IWYU. * Removed transistive includes from utility because there isn't too many headers that it is necessary. * Updated src/tuning/* with IWYU. * Updated src/routines/ and src/routines/level1 with IWYU. * Did all the files in src/routines/level2/ * Did IWYU on some of the files in src/routines/level3 * Finished IWYU on level 3 routines. * Added IWYU to the levelx routines. * Fixed the general purpose files in src/, the CUDA API should also be fixed but it might not be. * Exported 2 utilities in utilities/utilities.hpp because they ensure the library works with MSVC and android. * Applied IWYU to the database files that needed to be changed. * Applied IWYU to clblast_c.h in the include folder. * Removed android.hpp from include because it isn't supposed to be included explicitly. * Did minimalist changes to the tests to make sure they compile. Tested with cblas. * Added the .clangd used to apply IWYU for future contributors. * Removed unwanted includes of CL/cl.h * Fixed stddef include for the C API. * Removed open blas specific include that should not be there. * Fixed compilation error in test/routines/levelx/xhad.hpp * Update changelog. * Fixed clang format * Added missing include in a routine test to fix appveyor compilation. * Removed unused file. * Fixed HEADERS var. * Added Include What You Use for src/tuning/tuning.hpp * Added routines.hpp again to avoid duplication in api_common, clblast_cuda, and clblast.cpp * Improved readability and decreased the amount of pragmas. * Updated CMakeLists.txt; added routines.hpp into the HEADERS var.
1 parent d176318 commit 2f300c2

File tree

184 files changed

+1042
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+1042
-70
lines changed

.clangd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Diagnostics:
2+
MissingIncludes: Strict
3+
UnusedIncludes: Strict

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Development version (next version)
55
- Enabled parallel kernel compilation for faster kernel tuning (see doc/tuning.md)
66
- Removed all generator scripts for the API
77
- Added 3 new error codes for vector Z in routine XHAD
8+
- Added include what you use (IWYU) with Clangd Include Cleaner
89

910
Version 1.6.3
1011
- Fixed a bug in the GEMMK=1 kernel (with 2D register tiling) when MWG!=NWG

include/clblast_c.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#ifndef CLBLAST_CLBLAST_C_H_
1212
#define CLBLAST_CLBLAST_C_H_
1313

14+
#include <stddef.h>
15+
1416
// Includes the normal OpenCL C header
1517
#ifndef CL_TARGET_OPENCL_VERSION
1618
#define CL_TARGET_OPENCL_VERSION 110

src/api_common.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66
//
77
// =================================================================================================
88

9+
#include <cstddef>
910
#include <string>
11+
#include <unordered_map>
12+
#include <vector>
1013

1114
#include "cache.hpp"
15+
#include "clblast.h"
16+
#include "database/database_structure.hpp"
1217
#include "routines/routines.hpp"
18+
#include "utilities/backend.hpp"
19+
#include "utilities/clblast_exceptions.hpp"
1320
#include "utilities/utilities.hpp"
1421

1522
namespace clblast {

src/cache.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99

1010
#include "cache.hpp"
1111

12+
#include <memory>
1213
#include <mutex>
1314
#include <string>
14-
#include <vector>
15+
#include <utility>
1516

1617
#include "database/database.hpp"
18+
#include "utilities/backend.hpp"
1719

1820
namespace clblast {
1921
// =================================================================================================

src/cache.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
#ifndef CLBLAST_CACHE_H_
1111
#define CLBLAST_CACHE_H_
1212

13+
#include <functional>
1314
#include <map>
15+
#include <memory>
1416
#include <mutex>
1517
#include <string>
18+
#include <tuple>
1619

17-
#include "utilities/utilities.hpp"
20+
#include "clblast.h"
21+
#include "utilities/backend.hpp"
1822

1923
namespace clblast {
2024
// =================================================================================================

src/clblast.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@
1111

1212
#include "clblast.h"
1313

14+
#include <complex>
15+
#include <cstddef>
1416
#include <string>
17+
#include <vector>
1518

19+
#include "database/database.hpp"
1620
#include "routines/routines.hpp"
21+
#include "utilities/backend.hpp"
22+
#include "utilities/clblast_exceptions.hpp"
23+
#include "utilities/utilities.hpp"
1724

1825
namespace clblast {
1926

src/clblast_c.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99

1010
#include "clblast_c.h"
1111

12+
#include <cstddef>
1213
#include <string>
13-
#include <unordered_map>
1414

1515
#include "clblast.h"
16+
#include "utilities/clblast_exceptions.hpp"
1617
#include "utilities/utilities.hpp"
1718

1819
// Shortcuts to the clblast namespace

src/clblast_cuda.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@
1111

1212
#include "clblast_cuda.h"
1313

14+
#include <complex>
15+
#include <cstddef>
1416
#include <string>
1517

18+
#include "clblast.h"
19+
#include "database/database.hpp"
1620
#include "routines/routines.hpp"
21+
#include "utilities/backend.hpp"
22+
#include "utilities/clblast_exceptions.hpp"
1723

1824
namespace clblast {
1925

src/clblast_netlib_c.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
#include "clblast_netlib_c.h"
1313

1414
#include <cstdlib>
15+
#include <stdexcept>
1516

1617
#include "clblast.h"
18+
#include "utilities/backend.hpp"
1719
#include "utilities/utilities.hpp"
1820

1921
// Shortcuts to the clblast namespace

0 commit comments

Comments
 (0)