Skip to content

Commit 1ab121c

Browse files
Rename ctl internal header file
and clean up header guards in several header files.
1 parent 70c33d0 commit 1ab121c

16 files changed

+43
-26
lines changed

include/umf/providers/provider_cuda.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
*/
77

8-
#ifndef UMF_PROVIDER_CUDA_H
9-
#define UMF_PROVIDER_CUDA_H
8+
#ifndef UMF_CUDA_PROVIDER_H
9+
#define UMF_CUDA_PROVIDER_H
1010

1111
#include <umf/memory_provider_gpu.h>
1212

@@ -67,4 +67,4 @@ const umf_memory_provider_ops_t *umfCUDAMemoryProviderOps(void);
6767
}
6868
#endif
6969

70-
#endif /* UMF_PROVIDER_CUDA_H */
70+
#endif /* UMF_CUDA_PROVIDER_H */

include/umf/providers/provider_level_zero.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
*/
77

8-
#ifndef UMF_PROVIDER_LEVEL_ZERO_H
9-
#define UMF_PROVIDER_LEVEL_ZERO_H
8+
#ifndef UMF_LEVEL_ZERO_PROVIDER_H
9+
#define UMF_LEVEL_ZERO_PROVIDER_H
1010

1111
#include <umf/memory_provider_gpu.h>
1212

@@ -97,4 +97,4 @@ const umf_memory_provider_ops_t *umfLevelZeroMemoryProviderOps(void);
9797
}
9898
#endif
9999

100-
#endif /* UMF_PROVIDER_LEVEL_ZERO_H */
100+
#endif /* UMF_LEVEL_ZERO_PROVIDER_H */

src/ctl/ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* the library's internal state
1717
*/
1818

19-
#include "ctl.h"
19+
#include "ctl_internal.h"
2020

2121
#include <ctype.h>
2222
#include <limits.h>

src/ctl/ctl.h renamed to src/ctl/ctl_internal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
/* Copyright 2016-2020, Intel Corporation */
1313

1414
/*
15-
* ctl.h -- internal declaration of statistics and control related structures
15+
* ctl_internal.h -- internal declaration of statistics and control related structures
1616
*/
1717

18-
#ifndef UMF_CTL_H
19-
#define UMF_CTL_H 1
18+
#ifndef UMF_CTL_INTERNAL_H
19+
#define UMF_CTL_INTERNAL_H 1
2020

2121
#include <errno.h>
2222
#include <stddef.h>
@@ -245,4 +245,4 @@ umf_result_t ctl_query(struct ctl *ctl, void *ctx,
245245
}
246246
#endif
247247

248-
#endif
248+
#endif /* UMF_CTL_INTERNAL_H */

src/memory_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <string.h>
1616

1717
#include "base_alloc_global.h"
18-
#include "ctl/ctl.h"
18+
#include "ctl/ctl_internal.h"
1919
#include "libumf.h"
2020
#include "memory_pool_internal.h"
2121
#include "memory_provider_internal.h"

src/memory_provider_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <umf/memory_provider.h>
1616

17-
#include "ctl/ctl.h"
17+
#include "ctl/ctl_internal.h"
1818

1919
#ifdef __cplusplus
2020
extern "C" {

src/pool/pool_disjoint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <umf/memory_provider.h>
1919

2020
#include "base_alloc_global.h"
21-
#include "ctl/ctl.h"
21+
#include "ctl/ctl_internal.h"
2222
#include "pool_disjoint_internal.h"
2323
#include "provider/provider_tracking.h"
2424
#include "uthash/utlist.h"

src/pool/pool_scalable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <umf/pools/pool_scalable.h>
2020

2121
#include "base_alloc_global.h"
22-
#include "ctl/ctl.h"
22+
#include "ctl/ctl_internal.h"
2323
#include "libumf.h"
2424
#include "memory_pool_internal.h"
2525
#include "pool_scalable_internal.h"

src/pool/pool_scalable_internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@
77
*
88
*/
99

10+
#ifndef UMF_POOL_SCALABLE_INTERNAL_H
11+
#define UMF_POOL_SCALABLE_INTERNAL_H 1
12+
1013
void fini_tbb_global_state(void);
14+
15+
#endif /* UMF_POOL_SCALABLE_INTERNAL_H */

src/provider/provider_ctl_stats_impl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
extern "C" {
1919
#endif
2020

21-
#include "ctl/ctl.h"
21+
#include "ctl/ctl_internal.h"
2222
#include "utils/utils_assert.h"
2323

2424
static umf_result_t CTL_READ_HANDLER(peak_memory)(
@@ -106,4 +106,5 @@ static inline void provider_ctl_stats_free(CTL_PROVIDER_TYPE *provider,
106106
#ifdef __cplusplus
107107
}
108108
#endif
109-
#endif
109+
110+
#endif /* UMF_PROVIDER_CTL_STATS_IMPL_H */

src/provider/provider_ctl_stats_type.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ typedef struct ctl_stats_t {
2222
#ifdef __cplusplus
2323
}
2424
#endif
25-
#endif
25+
26+
#endif /* UMF_PROVIDER_CTL_STATS_TYPE_H */

src/provider/provider_cuda_internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@
77
*
88
*/
99

10+
#ifndef UMF_CUDA_PROVIDER_INTERNAL_H
11+
#define UMF_CUDA_PROVIDER_INTERNAL_H 1
12+
1013
void fini_cu_global_state(void);
14+
15+
#endif /* UMF_CUDA_PROVIDER_INTERNAL_H */

src/provider/provider_level_zero_internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@
77
*
88
*/
99

10+
#ifndef UMF_LEVEL_ZERO_PROVIDER_INTERNAL_H
11+
#define UMF_LEVEL_ZERO_PROVIDER_INTERNAL_H 1
12+
1013
void fini_ze_global_state(void);
14+
15+
#endif /* UMF_LEVEL_ZERO_PROVIDER_INTERNAL_H */

src/provider/provider_os_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <umf/memory_provider_ops.h>
2020
#include <umf/providers/provider_os_memory.h>
2121

22-
#include "ctl/ctl.h"
22+
#include "ctl/ctl_internal.h"
2323
#include "utils_assert.h"
2424
// OS Memory Provider requires HWLOC
2525
#if defined(UMF_NO_HWLOC)

test/ctl/ctl_debug.h

Lines changed: 6 additions & 6 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

1010
/*
11-
* ctl_debug.h -- definitions for CTL test
11+
* ctl_debug.h -- definitions for CTL tests
1212
*/
1313

14-
#ifndef UMF_CTL_DEBUG_H
15-
#define UMF_CTL_DEBUG_H 1
14+
#ifndef UMF_TEST_CTL_DEBUG_H
15+
#define UMF_TEST_CTL_DEBUG_H 1
1616

17-
#include "../src/ctl/ctl.h"
17+
#include "../src/ctl/ctl_internal.h"
1818

1919
#ifdef __cplusplus
2020
extern "C" {
@@ -29,4 +29,4 @@ void deinitialize_debug_ctl(void);
2929
}
3030
#endif
3131

32-
#endif
32+
#endif /* UMF_TEST_CTL_DEBUG_H */

test/ctl/ctl_unittest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*
88
*/
99

10+
#include "../../src/ctl/ctl_internal.h"
1011
#include "../common/base.hpp"
11-
#include "ctl/ctl.h"
1212
#include "ctl/ctl_debug.h"
1313

1414
using namespace umf_test;

0 commit comments

Comments
 (0)