From 92608e8af5bd00b5d053e245d8e09f2e1608d65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Plewa?= Date: Wed, 2 Jul 2025 12:07:13 +0200 Subject: [PATCH] move ctl to experimental --- benchmark/benchmark_umf.hpp | 1 + include/umf/base.h | 30 ----------------- include/umf/experimental/ctl.h | 53 +++++++++++++++++++++++++++++++ include/umf/memory_provider_ops.h | 3 ++ test/ctl/ctl_api.cpp | 1 + test/poolFixtures.hpp | 1 + test/pools/disjoint_pool_ctl.cpp | 1 + 7 files changed, 60 insertions(+), 30 deletions(-) create mode 100644 include/umf/experimental/ctl.h diff --git a/benchmark/benchmark_umf.hpp b/benchmark/benchmark_umf.hpp index 74551b20e3..526ae2eae4 100644 --- a/benchmark/benchmark_umf.hpp +++ b/benchmark/benchmark_umf.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/include/umf/base.h b/include/umf/base.h index ae0d43e15d..0bbafc309a 100644 --- a/include/umf/base.h +++ b/include/umf/base.h @@ -61,36 +61,6 @@ typedef enum umf_ctl_query_type { MAX_CTL_QUERY_TYPE } umf_ctl_query_type_t; -/// -/// @brief Get value of a specified attribute at the given name. -/// @param name name of an attribute to be retrieved -/// @param ctx pointer to the pool or the provider -/// @param arg [out] pointer to the variable where the value will be stored -/// @param size size of the value, depends on the context -/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. -/// -umf_result_t umfCtlGet(const char *name, void *ctx, void *arg, size_t size); - -/// -/// @brief Set value of a specified attribute at the given name. -/// @param name name of an attribute to be set -/// @param ctx pointer to the pool or the provider, NULL for the 'default' path -/// @param arg [in] pointer to the value that will be set -/// @param size [in] size of the value, depends on the context -/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. -/// -umf_result_t umfCtlSet(const char *name, void *ctx, void *arg, size_t size); - -/// -/// @brief Execute callback related with the specified attribute. -/// @param name name of an attribute to be executed -/// @param ctx pointer to the pool or the provider -/// @param arg [in/out] pointer to the value, can be used as an input or output -/// @param size [in] size of the value, depends on the context -/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. -/// -umf_result_t umfCtlExec(const char *name, void *ctx, void *arg, size_t size); - #ifdef __cplusplus } #endif diff --git a/include/umf/experimental/ctl.h b/include/umf/experimental/ctl.h new file mode 100644 index 0000000000..3454467621 --- /dev/null +++ b/include/umf/experimental/ctl.h @@ -0,0 +1,53 @@ +/* + * + * Copyright (C) 2024-2025 Intel Corporation + * + * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * + */ + +#ifndef UMF_CTL_H +#define UMF_CTL_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/// +/// @brief Get value of a specified attribute at the given name. +/// @param name name of an attribute to be retrieved +/// @param ctx pointer to the pool or the provider +/// @param arg [out] pointer to the variable where the value will be stored +/// @param size size of the value, depends on the context +/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. +/// +umf_result_t umfCtlGet(const char *name, void *ctx, void *arg, size_t size); + +/// +/// @brief Set value of a specified attribute at the given name. +/// @param name name of an attribute to be set +/// @param ctx pointer to the pool or the provider, NULL for the 'default' path +/// @param arg [in] pointer to the value that will be set +/// @param size [in] size of the value, depends on the context +/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. +/// +umf_result_t umfCtlSet(const char *name, void *ctx, void *arg, size_t size); + +/// +/// @brief Execute callback related with the specified attribute. +/// @param name name of an attribute to be executed +/// @param ctx pointer to the pool or the provider +/// @param arg [in/out] pointer to the value, can be used as an input or output +/// @param size [in] size of the value, depends on the context +/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure. +/// +umf_result_t umfCtlExec(const char *name, void *ctx, void *arg, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif /* UMF_CTL_H */ diff --git a/include/umf/memory_provider_ops.h b/include/umf/memory_provider_ops.h index 90741e9c28..adb468160f 100644 --- a/include/umf/memory_provider_ops.h +++ b/include/umf/memory_provider_ops.h @@ -258,6 +258,9 @@ typedef struct umf_memory_provider_ops_t { /// @brief Control operation for the memory provider. /// The function is used to perform various control operations /// on the memory provider. + /// \details + /// * This API is experimental and may change in future releases. + /// Backward compatibility is not guaranteed. /// /// @param provider handle to the memory provider. /// @param operationType type of the operation to be performed. diff --git a/test/ctl/ctl_api.cpp b/test/ctl/ctl_api.cpp index 8bbb9d8206..3c78ad1eaa 100644 --- a/test/ctl/ctl_api.cpp +++ b/test/ctl/ctl_api.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/test/poolFixtures.hpp b/test/poolFixtures.hpp index c9c98568a0..66351011c5 100644 --- a/test/poolFixtures.hpp +++ b/test/poolFixtures.hpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include diff --git a/test/pools/disjoint_pool_ctl.cpp b/test/pools/disjoint_pool_ctl.cpp index fa084b2216..cb2f870fad 100644 --- a/test/pools/disjoint_pool_ctl.cpp +++ b/test/pools/disjoint_pool_ctl.cpp @@ -3,6 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exceptiongi #include +#include #include #include #include