Skip to content

Commit dfef774

Browse files
author
Colin Davidson
committed
[CI][CLANG-FORMAT] Switch to clang-20-format
This keeps it in line with upstream dpc++
1 parent d729283 commit dfef774

1,016 files changed

Lines changed: 24577 additions & 25668 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,2 @@
11
---
2-
Language: Cpp
3-
BasedOnStyle: Google
4-
Standard: Cpp11
5-
IncludeBlocks: Regroup
6-
IncludeCategories:
7-
- Regex: '^<.*\.(h|hpp)>'
8-
Priority: 1
9-
- Regex: '^<.*'
10-
Priority: 2
11-
- Regex: '.*'
12-
Priority: 3
13-
DerivePointerAlignment: false
14-
QualifierAlignment: Left
15-
PointerAlignment: Right
16-
Macros:
17-
- CL_LAMBDA_CALLBACK=[[]]
18-
- VK_LAMBDA_CALLBACK=[[]]
19-
...
2+
BasedOnStyle: LLVM

.github/workflows/run_ock_internal_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ jobs:
172172

173173
- name: setup-ubuntu-clang-format
174174
run:
175-
pip install clang-format==19.1.0
175+
pip install clang-format==20.1.8
176176

177177
- name: run clang-format
178178
run: |
179-
# we've installed clang-format-19 in the docker via pip, which just installs it as clang-format,
179+
# we've installed clang-format-20 in the docker via pip, which just installs it as clang-format,
180180
# so just use clang-format-diff and -b clang-format directly
181181
git fetch origin ${{ github.base_ref }}
182182
git diff --no-color origin/${{ github.base_ref }} | \

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,12 @@ find_package(PythonInterp 3.6 REQUIRED)
197197
# which perform static analysis and style checking on source files.
198198
# When updating the version here, also update that used in the merge request
199199
# config
200-
find_package(ClangTools 19 COMPONENTS clang-format clang-tidy)
200+
find_package(ClangTools 19 COMPONENTS clang-tidy)
201+
if(TARGET ClangTools::clang-tidy)
202+
ca_option(CA_CLANG_TIDY_FLAGS STRING
203+
"Semi-color separated list of clang-tidy flags" "")
204+
endif()
205+
find_package(ClangTools 20 COMPONENTS clang-format)
201206
if(TARGET ClangTools::clang-tidy)
202207
ca_option(CA_CLANG_TIDY_FLAGS STRING
203208
"Semi-color separated list of clang-tidy flags" "")

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ To install the dependencies on Ubuntu, open the terminal and run:
4545

4646
### Recommended packages
4747
* [Ninja](https://ninja-build.org/)
48-
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html) 16
48+
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html) 20
4949
* [lit](https://llvm.org/docs/CommandGuide/lit.html)
5050

5151
To install the recommended packages, run:
5252
```sh
5353
$ sudo apt install -y ninja-build doxygen python3-pip
54-
$ sudo pip3 install lit virtualenv cmakelint clang-format==19.1.0
54+
$ sudo pip3 install lit virtualenv cmakelint clang-format==20.1.8
5555
```
5656

5757
### Compiling oneAPI Construction Kit

clik/external/hal_cpu/include/device/kernel_if.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ static uintptr_t start_dma(void *dst, const void *src, size_t size_in_bytes,
8383
return xfer_id;
8484
}
8585

86-
static void wait_dma(uintptr_t xfer_id, struct exec_state *e) { /* No-op */
87-
}
86+
static void wait_dma(uintptr_t xfer_id, struct exec_state *e) { /* No-op */ }
8887

8988
#endif // _HAL_CPU_KERNEL_IF_H

clik/external/hal_cpu/source/hal_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class cpu_hal_platform : public hal::hal_t {
5757

5858
cpu_hal_platform() {
5959
hal_device_info = &cpu_hal::setup_cpu_hal_device_info();
60-
60+
6161
static constexpr uint32_t implemented_api_version = 6;
6262
static_assert(implemented_api_version == hal_t::api_version,
6363
"Implemented API version for CPU HAL does not match hal.h");

examples/applications/simple-vector-add.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ constexpr sycl::access::mode sycl_write = sycl::access::mode::write;
3636

3737
/* This is the class used to name the kernel for the runtime.
3838
* This must be done when the kernel is expressed as a lambda. */
39-
template <typename T>
40-
class SimpleVadd;
39+
template <typename T> class SimpleVadd;
4140

4241
template <typename T, size_t N>
4342
void simple_vadd(const std::array<T, N> &VA, const std::array<T, N> &VB,

examples/applications/vector_addition-tiled-load-store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void storeTile(float *c, float *tile1, size_t id, size_t tile_i) {
4040

4141
class tiled_vec_add;
4242
int main(int argc, char *argv[]) {
43-
constexpr const size_t N = 128000; // this is the total vector size
44-
constexpr const size_t T = 32; // this is the tile size
43+
constexpr const size_t N = 128000; // this is the total vector size
44+
constexpr const size_t T = 32; // this is the tile size
4545
const sycl::range<1> VecSize{N};
4646
const sycl::range<1> tile_size(T);
4747

examples/hal_cpu_remote_server/hal_cpu_executable.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ int main(int argc, char **argv) {
5555

5656
for (;;) {
5757
switch (auto opt = getopt(argc, argv, "n:h")) {
58-
case 'n':
59-
node = optarg;
60-
continue;
61-
62-
case 'h':
63-
print_usage(std::cout, argv[0]);
64-
exit(0);
65-
default:
66-
std::cerr << "Error: Unexpected options '" << (char)opt << "'\n";
67-
print_usage(std::cerr, argv[0]);
68-
exit(1);
69-
70-
case -1:
71-
break;
58+
case 'n':
59+
node = optarg;
60+
continue;
61+
62+
case 'h':
63+
print_usage(std::cout, argv[0]);
64+
exit(0);
65+
default:
66+
std::cerr << "Error: Unexpected options '" << (char)opt << "'\n";
67+
print_usage(std::cerr, argv[0]);
68+
exit(1);
69+
70+
case -1:
71+
break;
7272
}
7373

7474
break;

examples/hals/hal_cpu_client/source/hal_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace hal {
2121
class hal_cpu_socket_client : public hal::hal_socket_client {
22-
public:
22+
public:
2323
hal_cpu_socket_client() : hal_socket_client(0) {
2424
static constexpr uint32_t implemented_api_version = 6;
2525
static_assert(
@@ -44,7 +44,7 @@ class hal_cpu_socket_client : public hal::hal_socket_client {
4444
return hal_device_info;
4545
}
4646
};
47-
} // namespace hal
47+
} // namespace hal
4848
static hal::hal_cpu_socket_client hal_object;
4949

5050
hal::hal_t *get_hal(uint32_t &api_version) {

0 commit comments

Comments
 (0)