| 2105 | } |
| 2106 | |
| 2107 | hipError_t validateImageObject(hipArray_t array, amd::Coord3D& origin, amd::Coord3D& copyRegion, |
| 2108 | amd::BufferRect* rect, amd::Image*& image) { |
| 2109 | if (array == nullptr) { |
| 2110 | return hipErrorInvalidValue; |
| 2111 | } |
| 2112 | |
| 2113 | cl_mem memObj = reinterpret_cast<cl_mem>(array->data); |
| 2114 | if (!is_valid(memObj)) { |
| 2115 | return hipErrorInvalidValue; |
| 2116 | } |
| 2117 | |
| 2118 | image = as_amd(memObj)->asImage(); |
| 2119 | if (!image->validateRegion(origin, copyRegion)) { |
| 2120 | return hipErrorInvalidValue; |
| 2121 | } |
| 2122 | |
| 2123 | if (!rect->create(static_cast<size_t*>(origin), static_cast<size_t*>(copyRegion), |
| 2124 | image->getRowPitch(), image->getSlicePitch())) { |
| 2125 | return hipErrorInvalidValue; |
| 2126 | } |
| 2127 | |
| 2128 | return hipSuccess; |
| 2129 | } |
| 2130 | |
| 2131 | hipError_t validateMemoryObject(const void* ptr, bool isDeviceMemory, amd::Coord3D& origin, |
| 2132 | amd::Coord3D& copyRegion, size_t rowPitch, size_t slicePitch, |
no test coverage detected