|
| 1 | +//===- Auto-generated file, part of the LLVM/Offload project --------------===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | + |
| 9 | +/////////////////////////////////////////////////////////////////////////////// |
| 10 | +offload_result_t offloadGetErrorDetails_val( |
| 11 | + size_t* SizeRet, const char** DetailStringRet) { |
| 12 | + if (true /*enableParameterValidation*/) { |
| 13 | + } |
| 14 | + |
| 15 | + return offloadGetErrorDetails_impl(SizeRet, DetailStringRet); |
| 16 | + |
| 17 | +} |
| 18 | +OFFLOAD_APIEXPORT offload_result_t OFFLOAD_APICALL offloadGetErrorDetails( |
| 19 | + size_t* SizeRet, const char** DetailStringRet) { |
| 20 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 21 | + std::cout << "---> offloadGetErrorDetails"; |
| 22 | + } |
| 23 | + |
| 24 | + offload_result_t result = offloadGetErrorDetails_val(SizeRet, DetailStringRet); |
| 25 | + |
| 26 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 27 | + offload_get_error_details_params_t Params = { &SizeRet, &DetailStringRet}; |
| 28 | + std::cout << "(" << &Params << ")"; |
| 29 | + std::cout << "-> " << result << "\n"; |
| 30 | + if (result != OFFLOAD_RESULT_SUCCESS && LastErrorDetails()) { |
| 31 | + std::cout << " *Error Details* " << *LastErrorDetails() << " \n"; |
| 32 | + } |
| 33 | + } |
| 34 | + return result; |
| 35 | +} |
| 36 | + |
| 37 | +/////////////////////////////////////////////////////////////////////////////// |
| 38 | +offload_result_t offloadPlatformGet_val( |
| 39 | + uint32_t NumEntries, offload_platform_handle_t* phPlatforms, uint32_t* pNumPlatforms) { |
| 40 | + if (true /*enableParameterValidation*/) { |
| 41 | + if (NumEntries == 0 && phPlatforms != NULL) { |
| 42 | + return OFFLOAD_RESULT_ERROR_INVALID_SIZE; |
| 43 | + } |
| 44 | + |
| 45 | + } |
| 46 | + |
| 47 | + return offloadPlatformGet_impl(NumEntries, phPlatforms, pNumPlatforms); |
| 48 | + |
| 49 | +} |
| 50 | +OFFLOAD_APIEXPORT offload_result_t OFFLOAD_APICALL offloadPlatformGet( |
| 51 | + uint32_t NumEntries, offload_platform_handle_t* phPlatforms, uint32_t* pNumPlatforms) { |
| 52 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 53 | + std::cout << "---> offloadPlatformGet"; |
| 54 | + } |
| 55 | + |
| 56 | + offload_result_t result = offloadPlatformGet_val(NumEntries, phPlatforms, pNumPlatforms); |
| 57 | + |
| 58 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 59 | + offload_platform_get_params_t Params = { &NumEntries, &phPlatforms, &pNumPlatforms}; |
| 60 | + std::cout << "(" << &Params << ")"; |
| 61 | + std::cout << "-> " << result << "\n"; |
| 62 | + if (result != OFFLOAD_RESULT_SUCCESS && LastErrorDetails()) { |
| 63 | + std::cout << " *Error Details* " << *LastErrorDetails() << " \n"; |
| 64 | + } |
| 65 | + } |
| 66 | + return result; |
| 67 | +} |
| 68 | + |
| 69 | +/////////////////////////////////////////////////////////////////////////////// |
| 70 | +offload_result_t offloadPlatformGetInfo_val( |
| 71 | + offload_platform_handle_t hPlatform, offload_platform_info_t propName, size_t propSize, void* pPropValue, size_t* pPropSizeRet) { |
| 72 | + if (true /*enableParameterValidation*/) { |
| 73 | + if (propSize == 0 && pPropValue != NULL) { |
| 74 | + return OFFLOAD_RESULT_ERROR_INVALID_SIZE; |
| 75 | + } |
| 76 | + |
| 77 | + if (propSize != 0 && pPropValue == NULL) { |
| 78 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_POINTER; |
| 79 | + } |
| 80 | + |
| 81 | + if (pPropValue == NULL && pPropSizeRet == NULL) { |
| 82 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_POINTER; |
| 83 | + } |
| 84 | + |
| 85 | + if (NULL == hPlatform) { |
| 86 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_HANDLE; |
| 87 | + } |
| 88 | + |
| 89 | + } |
| 90 | + |
| 91 | + return offloadPlatformGetInfo_impl(hPlatform, propName, propSize, pPropValue, pPropSizeRet); |
| 92 | + |
| 93 | +} |
| 94 | +OFFLOAD_APIEXPORT offload_result_t OFFLOAD_APICALL offloadPlatformGetInfo( |
| 95 | + offload_platform_handle_t hPlatform, offload_platform_info_t propName, size_t propSize, void* pPropValue, size_t* pPropSizeRet) { |
| 96 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 97 | + std::cout << "---> offloadPlatformGetInfo"; |
| 98 | + } |
| 99 | + |
| 100 | + offload_result_t result = offloadPlatformGetInfo_val(hPlatform, propName, propSize, pPropValue, pPropSizeRet); |
| 101 | + |
| 102 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 103 | + offload_platform_get_info_params_t Params = { &hPlatform, &propName, &propSize, &pPropValue, &pPropSizeRet}; |
| 104 | + std::cout << "(" << &Params << ")"; |
| 105 | + std::cout << "-> " << result << "\n"; |
| 106 | + if (result != OFFLOAD_RESULT_SUCCESS && LastErrorDetails()) { |
| 107 | + std::cout << " *Error Details* " << *LastErrorDetails() << " \n"; |
| 108 | + } |
| 109 | + } |
| 110 | + return result; |
| 111 | +} |
| 112 | + |
| 113 | +/////////////////////////////////////////////////////////////////////////////// |
| 114 | +offload_result_t offloadDeviceGet_val( |
| 115 | + offload_platform_handle_t hPlatform, offload_device_type_t DeviceType, uint32_t NumEntries, offload_device_handle_t* phDevices, uint32_t* pNumDevices) { |
| 116 | + if (true /*enableParameterValidation*/) { |
| 117 | + if (NumEntries == 0 && phDevices != NULL) { |
| 118 | + return OFFLOAD_RESULT_ERROR_INVALID_SIZE; |
| 119 | + } |
| 120 | + |
| 121 | + if (NumEntries > 0 && phDevices == NULL) { |
| 122 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_POINTER; |
| 123 | + } |
| 124 | + |
| 125 | + if (NULL == hPlatform) { |
| 126 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_HANDLE; |
| 127 | + } |
| 128 | + |
| 129 | + } |
| 130 | + |
| 131 | + return offloadDeviceGet_impl(hPlatform, DeviceType, NumEntries, phDevices, pNumDevices); |
| 132 | + |
| 133 | +} |
| 134 | +OFFLOAD_APIEXPORT offload_result_t OFFLOAD_APICALL offloadDeviceGet( |
| 135 | + offload_platform_handle_t hPlatform, offload_device_type_t DeviceType, uint32_t NumEntries, offload_device_handle_t* phDevices, uint32_t* pNumDevices) { |
| 136 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 137 | + std::cout << "---> offloadDeviceGet"; |
| 138 | + } |
| 139 | + |
| 140 | + offload_result_t result = offloadDeviceGet_val(hPlatform, DeviceType, NumEntries, phDevices, pNumDevices); |
| 141 | + |
| 142 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 143 | + offload_device_get_params_t Params = { &hPlatform, &DeviceType, &NumEntries, &phDevices, &pNumDevices}; |
| 144 | + std::cout << "(" << &Params << ")"; |
| 145 | + std::cout << "-> " << result << "\n"; |
| 146 | + if (result != OFFLOAD_RESULT_SUCCESS && LastErrorDetails()) { |
| 147 | + std::cout << " *Error Details* " << *LastErrorDetails() << " \n"; |
| 148 | + } |
| 149 | + } |
| 150 | + return result; |
| 151 | +} |
| 152 | + |
| 153 | +/////////////////////////////////////////////////////////////////////////////// |
| 154 | +offload_result_t offloadDeviceGetInfo_val( |
| 155 | + offload_device_handle_t hDevice, offload_device_info_t propName, size_t propSize, void* pPropValue, size_t* pPropSizeRet) { |
| 156 | + if (true /*enableParameterValidation*/) { |
| 157 | + if (propSize == 0 && pPropValue != NULL) { |
| 158 | + return OFFLOAD_RESULT_ERROR_INVALID_SIZE; |
| 159 | + } |
| 160 | + |
| 161 | + if (propSize != 0 && pPropValue == NULL) { |
| 162 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_POINTER; |
| 163 | + } |
| 164 | + |
| 165 | + if (pPropValue == NULL && pPropSizeRet == NULL) { |
| 166 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_POINTER; |
| 167 | + } |
| 168 | + |
| 169 | + if (NULL == hDevice) { |
| 170 | + return OFFLOAD_RESULT_ERROR_INVALID_NULL_HANDLE; |
| 171 | + } |
| 172 | + |
| 173 | + } |
| 174 | + |
| 175 | + return offloadDeviceGetInfo_impl(hDevice, propName, propSize, pPropValue, pPropSizeRet); |
| 176 | + |
| 177 | +} |
| 178 | +OFFLOAD_APIEXPORT offload_result_t OFFLOAD_APICALL offloadDeviceGetInfo( |
| 179 | + offload_device_handle_t hDevice, offload_device_info_t propName, size_t propSize, void* pPropValue, size_t* pPropSizeRet) { |
| 180 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 181 | + std::cout << "---> offloadDeviceGetInfo"; |
| 182 | + } |
| 183 | + |
| 184 | + offload_result_t result = offloadDeviceGetInfo_val(hDevice, propName, propSize, pPropValue, pPropSizeRet); |
| 185 | + |
| 186 | + if (std::getenv("OFFLOAD_TRACE")) { |
| 187 | + offload_device_get_info_params_t Params = { &hDevice, &propName, &propSize, &pPropValue, &pPropSizeRet}; |
| 188 | + std::cout << "(" << &Params << ")"; |
| 189 | + std::cout << "-> " << result << "\n"; |
| 190 | + if (result != OFFLOAD_RESULT_SUCCESS && LastErrorDetails()) { |
| 191 | + std::cout << " *Error Details* " << *LastErrorDetails() << " \n"; |
| 192 | + } |
| 193 | + } |
| 194 | + return result; |
| 195 | +} |
0 commit comments