MCPcopy Create free account
hub / github.com/ROCm/clr / validateImageObject

Function validateImageObject

hipamd/src/hip_memory.cpp:2107–2129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2105}
2106
2107hipError_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
2131hipError_t validateMemoryObject(const void* ptr, bool isDeviceMemory, amd::Coord3D& origin,
2132 amd::Coord3D& copyRegion, size_t rowPitch, size_t slicePitch,

Callers 1

ihipDrvMemcpy3D_validateFunction · 0.85

Calls 7

as_amdFunction · 0.85
validateRegionMethod · 0.80
getRowPitchMethod · 0.80
getSlicePitchMethod · 0.80
is_validFunction · 0.50
asImageMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected