Skip to content

Commit 5dd549d

Browse files
Merge pull request #1405 from lplewa/ctl_experiment
move ctl to experimental
2 parents dd21e59 + 92608e8 commit 5dd549d

File tree

7 files changed

+60
-30
lines changed

7 files changed

+60
-30
lines changed

benchmark/benchmark_umf.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <thread>
1010

1111
#include <benchmark/benchmark.h>
12+
#include <umf/experimental/ctl.h>
1213
#include <umf/memory_pool.h>
1314
#include <umf/memory_provider.h>
1415
#include <umf/pools/pool_disjoint.h>

include/umf/base.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -61,36 +61,6 @@ typedef enum umf_ctl_query_type {
6161
MAX_CTL_QUERY_TYPE
6262
} umf_ctl_query_type_t;
6363

64-
///
65-
/// @brief Get value of a specified attribute at the given name.
66-
/// @param name name of an attribute to be retrieved
67-
/// @param ctx pointer to the pool or the provider
68-
/// @param arg [out] pointer to the variable where the value will be stored
69-
/// @param size size of the value, depends on the context
70-
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
71-
///
72-
umf_result_t umfCtlGet(const char *name, void *ctx, void *arg, size_t size);
73-
74-
///
75-
/// @brief Set value of a specified attribute at the given name.
76-
/// @param name name of an attribute to be set
77-
/// @param ctx pointer to the pool or the provider, NULL for the 'default' path
78-
/// @param arg [in] pointer to the value that will be set
79-
/// @param size [in] size of the value, depends on the context
80-
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
81-
///
82-
umf_result_t umfCtlSet(const char *name, void *ctx, void *arg, size_t size);
83-
84-
///
85-
/// @brief Execute callback related with the specified attribute.
86-
/// @param name name of an attribute to be executed
87-
/// @param ctx pointer to the pool or the provider
88-
/// @param arg [in/out] pointer to the value, can be used as an input or output
89-
/// @param size [in] size of the value, depends on the context
90-
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
91-
///
92-
umf_result_t umfCtlExec(const char *name, void *ctx, void *arg, size_t size);
93-
9464
#ifdef __cplusplus
9565
}
9666
#endif

include/umf/experimental/ctl.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
*
3+
* Copyright (C) 2024-2025 Intel Corporation
4+
*
5+
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
6+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
*
8+
*/
9+
10+
#ifndef UMF_CTL_H
11+
#define UMF_CTL_H 1
12+
13+
#include <umf/base.h>
14+
15+
#ifdef __cplusplus
16+
extern "C" {
17+
#endif
18+
19+
///
20+
/// @brief Get value of a specified attribute at the given name.
21+
/// @param name name of an attribute to be retrieved
22+
/// @param ctx pointer to the pool or the provider
23+
/// @param arg [out] pointer to the variable where the value will be stored
24+
/// @param size size of the value, depends on the context
25+
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
26+
///
27+
umf_result_t umfCtlGet(const char *name, void *ctx, void *arg, size_t size);
28+
29+
///
30+
/// @brief Set value of a specified attribute at the given name.
31+
/// @param name name of an attribute to be set
32+
/// @param ctx pointer to the pool or the provider, NULL for the 'default' path
33+
/// @param arg [in] pointer to the value that will be set
34+
/// @param size [in] size of the value, depends on the context
35+
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
36+
///
37+
umf_result_t umfCtlSet(const char *name, void *ctx, void *arg, size_t size);
38+
39+
///
40+
/// @brief Execute callback related with the specified attribute.
41+
/// @param name name of an attribute to be executed
42+
/// @param ctx pointer to the pool or the provider
43+
/// @param arg [in/out] pointer to the value, can be used as an input or output
44+
/// @param size [in] size of the value, depends on the context
45+
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
46+
///
47+
umf_result_t umfCtlExec(const char *name, void *ctx, void *arg, size_t size);
48+
49+
#ifdef __cplusplus
50+
}
51+
#endif
52+
53+
#endif /* UMF_CTL_H */

include/umf/memory_provider_ops.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ typedef struct umf_memory_provider_ops_t {
258258
/// @brief Control operation for the memory provider.
259259
/// The function is used to perform various control operations
260260
/// on the memory provider.
261+
/// \details
262+
/// * This API is experimental and may change in future releases.
263+
/// Backward compatibility is not guaranteed.
261264
///
262265
/// @param provider handle to the memory provider.
263266
/// @param operationType type of the operation to be performed.

test/ctl/ctl_api.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include <umf.h>
2121
#include <umf/base.h>
22+
#include <umf/experimental/ctl.h>
2223
#include <umf/memory_pool.h>
2324
#include <umf/memory_provider.h>
2425
#include <umf/pools/pool_disjoint.h>

test/poolFixtures.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <string>
1414
#include <thread>
1515

16+
#include <umf/experimental/ctl.h>
1617
#include <umf/pools/pool_proxy.h>
1718
#include <umf/providers/provider_devdax_memory.h>
1819
#include <umf/providers/provider_fixed_memory.h>

test/pools/disjoint_pool_ctl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exceptiongi
44

55
#include <gtest/gtest.h>
6+
#include <umf/experimental/ctl.h>
67
#include <umf/memory_pool.h>
78
#include <umf/memory_provider.h>
89
#include <umf/memory_provider_ops.h>

0 commit comments

Comments
 (0)