| 2451 | } |
| 2452 | |
| 2453 | hipError_t hipMemcpy2DValidateArray(hipArray_const_t arr, size_t wOffset, size_t hOffset, |
| 2454 | size_t width, size_t height) { |
| 2455 | if (arr == nullptr) { |
| 2456 | return hipErrorInvalidHandle; |
| 2457 | } |
| 2458 | |
| 2459 | int FormatSize = hip::getElementSize(arr); |
| 2460 | if ((width + wOffset) > (arr->width * FormatSize)) { |
| 2461 | return hipErrorInvalidValue; |
| 2462 | } |
| 2463 | if (arr->height == 0) { // 1D hipArray |
| 2464 | if (height + hOffset > 1) { |
| 2465 | return hipErrorInvalidValue; |
| 2466 | } |
| 2467 | } else if ((height + hOffset) > (arr->height)) { // 2D hipArray |
| 2468 | return hipErrorInvalidValue; |
| 2469 | } |
| 2470 | |
| 2471 | return hipSuccess; |
| 2472 | } |
| 2473 | |
| 2474 | hipError_t hipMemcpy2D_common(void* dst, size_t dpitch, const void* src, size_t spitch, |
| 2475 | size_t width, size_t height, hipMemcpyKind kind, |
no test coverage detected