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

Function hipTexRefGetArray

hipamd/src/hip_texture.cpp:942–969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940}
941
942hipError_t hipTexRefGetArray(hipArray_t* pArray, const textureReference* texRef) {
943 // TODO overload operator<<(ostream&, textureReference&).
944 HIP_INIT_API(hipTexRefGetArray, pArray, texRef);
945
946 if ((pArray == nullptr) || (texRef == nullptr)) {
947 HIP_RETURN(hipErrorInvalidValue);
948 }
949
950 hipResourceDesc resDesc = {};
951 // TODO use ihipGetTextureObjectResourceDesc() to not pollute the API trace.
952 hipError_t error = ihipGetTextureObjectResourceDesc(&resDesc, texRef->textureObject);
953 if (error != hipSuccess) {
954 HIP_RETURN(error);
955 }
956
957 switch (resDesc.resType) {
958 case hipResourceTypeLinear:
959 case hipResourceTypePitch2D:
960 case hipResourceTypeMipmappedArray: {
961 HIP_RETURN(hipErrorInvalidValue);
962 }
963 case hipResourceTypeArray:
964 *pArray = resDesc.res.array.array;
965 break;
966 }
967
968 HIP_RETURN(hipSuccess);
969}
970
971hipError_t hipTexRefSetArray(textureReference* texRef, hipArray_const_t array, unsigned int flags) {
972 HIP_INIT_API(hipTexRefSetArray, texRef, array, flags);

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected