Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

152 lines
6.3 KiB

  1. ! BSD 2-Clause License
  2. !
  3. ! Copyright (c) 2021-2022, Hewlett Packard Enterprise
  4. ! All rights reserved.
  5. !
  6. ! Redistribution and use in source and binary forms, with or without
  7. ! modification, are permitted provided that the following conditions are met:
  8. !
  9. ! 1. Redistributions of source code must retain the above copyright notice, this
  10. ! list of conditions and the following disclaimer.
  11. !
  12. ! 2. Redistributions in binary form must reproduce the above copyright notice,
  13. ! this list of conditions and the following disclaimer in the documentation
  14. ! and/or other materials provided with the distribution.
  15. !
  16. ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  20. ! FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. ! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  22. ! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. ! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. ! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25. ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. interface
  27. function c_constructor(cluster, new_client) bind(c, name="SmartRedisCClient")
  28. use iso_c_binding, only : c_ptr, c_bool
  29. import :: enum_kind
  30. integer(kind=enum_kind) :: c_constructor
  31. logical(kind=c_bool), value :: cluster !< True if a database cluster is being used
  32. type(c_ptr) :: new_client !< Receives the newly constructed client
  33. end function c_constructor
  34. end interface
  35. interface
  36. function c_destructor(client) bind(c, name="DeleteCClient")
  37. use iso_c_binding, only : c_ptr
  38. import :: enum_kind
  39. integer(kind=enum_kind) :: c_destructor
  40. type(c_ptr) :: client
  41. end function c_destructor
  42. end interface
  43. interface
  44. function model_exists_c(client, model_name, model_name_length, exists) bind(c, name="model_exists")
  45. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t
  46. import :: enum_kind
  47. integer(kind=enum_kind) :: model_exists_c
  48. type(c_ptr), value :: client
  49. character(kind=c_char) :: model_name(*)
  50. integer(kind=c_size_t), value :: model_name_length
  51. logical(kind=c_bool) :: exists
  52. end function model_exists_c
  53. end interface
  54. interface
  55. function tensor_exists_c(client, tensor_name, tensor_name_length, exists) bind(c, name="tensor_exists")
  56. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t
  57. import :: enum_kind
  58. integer(kind=enum_kind) :: tensor_exists_c
  59. type(c_ptr), value :: client
  60. character(kind=c_char) :: tensor_name(*)
  61. integer(kind=c_size_t), value :: tensor_name_length
  62. logical(kind=c_bool) :: exists
  63. end function tensor_exists_c
  64. end interface
  65. interface
  66. function dataset_exists_c(client, dataset_name, dataset_name_length, exists) bind(c, name="dataset_exists")
  67. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t
  68. import :: enum_kind
  69. integer(kind=enum_kind) :: dataset_exists_c
  70. type(c_ptr), value :: client
  71. character(kind=c_char) :: dataset_name(*)
  72. integer(kind=c_size_t), value :: dataset_name_length
  73. logical(kind=c_bool) :: exists
  74. end function dataset_exists_c
  75. end interface
  76. interface
  77. function key_exists_c(client, key, key_length, exists) bind(c, name="key_exists")
  78. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t
  79. import :: enum_kind
  80. integer(kind=enum_kind) :: key_exists_c
  81. type(c_ptr), value :: client
  82. character(kind=c_char) :: key(*)
  83. integer(kind=c_size_t), value :: key_length
  84. logical(kind=c_bool) :: exists
  85. end function key_exists_c
  86. end interface
  87. interface
  88. function poll_model_c(client, model_name, model_name_length, poll_frequency_ms, num_tries, exists)&
  89. bind(c, name="poll_model")
  90. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  91. import :: enum_kind
  92. integer(kind=enum_kind) :: poll_model_c
  93. type(c_ptr), value :: client
  94. character(kind=c_char) :: model_name(*)
  95. integer(kind=c_size_t), value :: model_name_length
  96. integer(kind=c_int), value :: poll_frequency_ms
  97. integer(kind=c_int), value :: num_tries
  98. logical(kind=c_bool) :: exists
  99. end function poll_model_c
  100. end interface
  101. interface
  102. function poll_tensor_c(client, tensor_name, tensor_name_length, poll_frequency_ms, num_tries, exists)&
  103. bind(c, name="poll_tensor")
  104. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  105. import :: enum_kind
  106. integer(kind=enum_kind) :: poll_tensor_c
  107. type(c_ptr), value :: client
  108. character(kind=c_char) :: tensor_name(*)
  109. integer(kind=c_size_t), value :: tensor_name_length
  110. integer(kind=c_int), value :: poll_frequency_ms
  111. integer(kind=c_int), value :: num_tries
  112. logical(kind=c_bool) :: exists
  113. end function poll_tensor_c
  114. end interface
  115. interface
  116. function poll_dataset_c(client, tensor_name, tensor_name_length, poll_frequency_ms, num_tries, exists)&
  117. bind(c, name="poll_dataset")
  118. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  119. import :: enum_kind
  120. integer(kind=enum_kind) :: poll_dataset_c
  121. type(c_ptr), value :: client
  122. character(kind=c_char) :: tensor_name(*)
  123. integer(kind=c_size_t), value :: tensor_name_length
  124. integer(kind=c_int), value :: poll_frequency_ms
  125. integer(kind=c_int), value :: num_tries
  126. logical(kind=c_bool) :: exists
  127. end function poll_dataset_c
  128. end interface
  129. interface
  130. function poll_key_c(client, key, key_length, poll_frequency_ms, num_tries, exists) bind(c, name="poll_key")
  131. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  132. import :: enum_kind
  133. integer(kind=enum_kind) :: poll_key_c
  134. type(c_ptr), value :: client
  135. character(kind=c_char) :: key(*)
  136. integer(kind=c_size_t), value :: key_length
  137. integer(kind=c_int), value :: poll_frequency_ms
  138. integer(kind=c_int), value :: num_tries
  139. logical(kind=c_bool) :: exists
  140. end function poll_key_c
  141. end interface