Skip to content

Commit 9d00875

Browse files
committed
cleanup includes order
1 parent de9fa7f commit 9d00875

11 files changed

+67
-63
lines changed

test/ipcFixtures.hpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@
55
#ifndef UMF_TEST_IPC_FIXTURES_HPP
66
#define UMF_TEST_IPC_FIXTURES_HPP
77

8-
#include "base.hpp"
9-
#include "multithread_helpers.hpp"
10-
#include "pool.hpp"
11-
#include "test_helpers.h"
8+
#include <algorithm>
9+
#include <cstring>
10+
#include <numeric>
11+
#include <random>
12+
#include <tuple>
1213

1314
#include <umf/ipc.h>
1415
#include <umf/memory_pool.h>
1516
#include <umf/memory_provider.h>
1617
#include <umf/pools/pool_proxy.h>
1718

18-
#include <algorithm>
19-
#include <cstring>
20-
#include <numeric>
21-
#include <random>
22-
#include <tuple>
19+
#include "base.hpp"
20+
#include "multithread_helpers.hpp"
21+
#include "pool.hpp"
22+
#include "test_helpers.h"
2323

2424
class MemoryAccessor {
2525
public:
2626
virtual ~MemoryAccessor() = default;
2727
virtual void fill(void *ptr, size_t size, const void *pattern,
2828
size_t pattern_size) = 0;
2929
virtual void copy(void *dst_ptr, void *src_ptr, size_t size) = 0;
30+
virtual const char *getName() = 0;
3031
};
3132

3233
class HostMemoryAccessor : public MemoryAccessor {
@@ -47,6 +48,8 @@ class HostMemoryAccessor : public MemoryAccessor {
4748
void copy(void *dst_ptr, void *src_ptr, size_t size) override {
4849
std::memcpy(dst_ptr, src_ptr, size);
4950
}
51+
52+
const char *getName() override { return "HostMemoryAccessor"; }
5053
};
5154

5255
typedef void *(*pfnPoolParamsCreate)();

test/memoryPoolAPI.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
// This file contains tests for UMF pool API
55

6-
#include "base.hpp"
7-
#include "pool.hpp"
8-
#include "poolFixtures.hpp"
9-
#include "provider.hpp"
10-
#include "provider_null.h"
11-
#include "provider_trace.h"
12-
#include "test_helpers.h"
6+
#include <array>
7+
#include <string>
8+
#include <thread>
9+
#include <type_traits>
10+
#include <unordered_map>
11+
#include <variant>
1312

1413
#include <umf/memory_provider.h>
1514
#include <umf/pools/pool_disjoint.h>
@@ -19,12 +18,13 @@
1918
#include <umf/proxy_lib_new_delete.h>
2019
#endif
2120

22-
#include <array>
23-
#include <string>
24-
#include <thread>
25-
#include <type_traits>
26-
#include <unordered_map>
27-
#include <variant>
21+
#include "base.hpp"
22+
#include "pool.hpp"
23+
#include "poolFixtures.hpp"
24+
#include "provider.hpp"
25+
#include "provider_null.h"
26+
#include "provider_trace.h"
27+
#include "test_helpers.h"
2828

2929
using umf_test::test;
3030
using namespace umf_test;

test/pools/pool_base_alloc.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
#include <umf/pools/pool_scalable.h>
88
#include <umf/providers/provider_os_memory.h>
99

10+
#include "base_alloc_global.h"
1011
#include "pool.hpp"
1112
#include "poolFixtures.hpp"
1213
#include "provider.hpp"
1314

14-
#include "base_alloc_global.h"
15-
1615
struct base_alloc_pool : public umf_test::pool_base_t {
1716

1817
void *malloc(size_t size) noexcept { return umf_ba_global_alloc(size); }

test/provider_devdax_memory.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

55
#ifndef _WIN32
6-
#include "test_helpers_linux.h"
76
#include <fcntl.h>
87
#include <sys/stat.h>
98
#include <sys/types.h>
109
#endif
1110

12-
#include "base.hpp"
11+
#include <umf/memory_provider.h>
12+
#include <umf/providers/provider_devdax_memory.h>
1313

14+
#include "base.hpp"
15+
#include "provider.hpp"
1416
#include "test_helpers.h"
1517
#include "utils/cpp_helpers.hpp"
16-
17-
#include <umf/memory_provider.h>
18-
#include <umf/providers/provider_devdax_memory.h>
18+
#ifndef _WIN32
19+
#include "test_helpers_linux.h"
20+
#endif
1921

2022
using umf_test::test;
2123

test/provider_file_memory.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
#include "base.hpp"
5+
#include <umf/memory_provider.h>
6+
#include <umf/providers/provider_file_memory.h>
67

8+
#include "base.hpp"
9+
#include "provider.hpp"
710
#include "test_helpers.h"
811
#include "utils/cpp_helpers.hpp"
912
#ifndef _WIN32
1013
#include "test_helpers_linux.h"
1114
#endif
1215

13-
#include <umf/memory_provider.h>
14-
#include <umf/providers/provider_file_memory.h>
15-
1616
using umf_test::test;
1717

1818
#define FILE_PATH ((char *)"tmp_file")

test/provider_fixed_memory.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
#include "base.hpp"
5+
#include <umf/memory_provider.h>
6+
#include <umf/pools/pool_proxy.h>
7+
#include <umf/providers/provider_fixed_memory.h>
68

9+
#include "base.hpp"
10+
#include "provider.hpp"
711
#include "test_helpers.h"
812
#include "utils/cpp_helpers.hpp"
913
#ifndef _WIN32
1014
#include "test_helpers_linux.h"
1115
#endif
1216

13-
#include <umf/memory_provider.h>
14-
#include <umf/pools/pool_proxy.h>
15-
#include <umf/providers/provider_fixed_memory.h>
16-
1717
using umf_test::test;
1818

1919
#define FIXED_BUFFER_SIZE (10 * utils_get_page_size())

test/provider_os_memory.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
#include "base.hpp"
6-
7-
#include "ipcFixtures.hpp"
8-
#include "test_helpers.h"
9-
#include "utils/cpp_helpers.hpp"
10-
115
#include <umf/memory_provider.h>
126
#include <umf/pools/pool_disjoint.h>
137
#include <umf/providers/provider_os_memory.h>
148
#ifdef UMF_POOL_JEMALLOC_ENABLED
159
#include <umf/pools/pool_jemalloc.h>
1610
#endif
1711

12+
#include "base.hpp"
13+
#include "ipcFixtures.hpp"
14+
#include "provider.hpp"
15+
#include "test_helpers.h"
16+
#include "utils/cpp_helpers.hpp"
17+
1818
using umf_test::test;
1919

2020
#define INVALID_PTR ((void *)0x01)

test/provider_os_memory_config.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/*
22
*
3-
* Copyright (C) 2024 Intel Corporation
3+
* Copyright (C) 2024-2025 Intel Corporation
44
*
55
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
66
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
77
*
88
*/
99

10+
#include <numa.h>
11+
#include <numaif.h>
12+
1013
#include "base.hpp"
1114

1215
#include <umf/memory_provider.h>
1316
#include <umf/providers/provider_os_memory.h>
1417

15-
#include <numa.h>
16-
#include <numaif.h>
17-
1818
static constexpr size_t allocSize = 4096;
1919

2020
struct providerConfigTest : testing::Test {

test/provider_os_memory_multiple_numa_nodes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
// Copyright (C) 2024 Intel Corporation
1+
// Copyright (C) 2024-2025 Intel Corporation
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
#include "base.hpp"
6-
#include "numa_helpers.hpp"
7-
#include "test_helpers.h"
8-
95
#include <algorithm>
106
#include <numa.h>
117
#include <numaif.h>
@@ -14,6 +10,10 @@
1410

1511
#include <umf/providers/provider_os_memory.h>
1612

13+
#include "base.hpp"
14+
#include "numa_helpers.hpp"
15+
#include "test_helpers.h"
16+
1717
std::vector<unsigned> get_available_numa_nodes() {
1818
if (numa_available() == -1 || numa_all_nodes_ptr == nullptr) {
1919
return std::vector<unsigned>();

test/provider_tracking.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
#include "base.hpp"
5+
#include <umf/memory_provider.h>
6+
#include <umf/pools/pool_proxy.h>
7+
#include <umf/providers/provider_fixed_memory.h>
68

9+
#include "base.hpp"
10+
#include "provider.hpp"
711
#include "test_helpers.h"
812
#include "utils/cpp_helpers.hpp"
913
#ifndef _WIN32
1014
#include "test_helpers_linux.h"
1115
#endif
1216

13-
#include <umf/memory_provider.h>
14-
#include <umf/pools/pool_proxy.h>
15-
#include <umf/providers/provider_fixed_memory.h>
16-
1717
using umf_test::test;
1818

1919
#define FIXED_BUFFER_SIZE (512 * utils_get_page_size())

0 commit comments

Comments
 (0)