pd_utils.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. ///
  15. /// \file pd_utils.h
  16. ///
  17. /// \brief Some utility function to destroy paddle struct.
  18. ///
  19. /// \author paddle-infer@baidu.com
  20. /// \date 2021-04-21
  21. /// \since 2.1
  22. ///
  23. #pragma once
  24. #include <stdint.h>
  25. #include <stdio.h>
  26. #include "pd_types.h" // NOLINT
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. ///
  31. /// \brief Destroy the PD_OneDimArrayInt32 object pointed to by the pointer.
  32. ///
  33. /// \param[in] array pointer to the PD_OneDimArrayInt32 object.
  34. ///
  35. PADDLE_CAPI_EXPORT extern void PD_OneDimArrayInt32Destroy(
  36. __pd_take PD_OneDimArrayInt32* array);
  37. ///
  38. /// \brief Destroy the PD_OneDimArrayCstr object pointed to by the pointer.
  39. ///
  40. /// \param[in] array pointer to the PD_OneDimArrayCstr object.
  41. ///
  42. PADDLE_CAPI_EXPORT extern void PD_OneDimArrayCstrDestroy(
  43. __pd_take PD_OneDimArrayCstr* array);
  44. ///
  45. /// \brief Destroy the PD_OneDimArraySize object pointed to by the pointer.
  46. ///
  47. /// \param[in] array pointer to the PD_OneDimArraySize object.
  48. ///
  49. PADDLE_CAPI_EXPORT extern void PD_OneDimArraySizeDestroy(
  50. __pd_take PD_OneDimArraySize* array);
  51. ///
  52. /// \brief Destroy the PD_TwoDimArraySize object pointed to by the pointer.
  53. ///
  54. /// \param[in] array pointer to the PD_TwoDimArraySize object.
  55. ///
  56. PADDLE_CAPI_EXPORT extern void PD_TwoDimArraySizeDestroy(
  57. __pd_take PD_TwoDimArraySize* array);
  58. ///
  59. /// \brief Destroy the PD_Cstr object pointed to by the pointer.
  60. /// NOTE: if input string is empty, the return PD_Cstr's size is
  61. /// 0 and data is NULL.
  62. ///
  63. /// \param[in] cstr pointer to the PD_Cstr object.
  64. ///
  65. PADDLE_CAPI_EXPORT extern void PD_CstrDestroy(__pd_take PD_Cstr* cstr);
  66. #ifdef __cplusplus
  67. } // extern "C"
  68. #endif