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

Function hipMallocArray

hipamd/src/hip_memory.cpp:1231–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1229
1230
1231hipError_t hipMallocArray(hipArray_t* array, const hipChannelFormatDesc* desc, size_t width,
1232 size_t height, unsigned int flags) {
1233 HIP_INIT_API(hipMallocArray, array, desc, width, height, flags);
1234 if (array == nullptr || desc == nullptr) {
1235 return hipErrorInvalidValue;
1236 }
1237 CHECK_STREAM_CAPTURE_SUPPORTED();
1238 HIP_ARRAY3D_DESCRIPTOR allocateArray = {width,
1239 height,
1240 0, /* Depth */
1241 hip::getArrayFormat(*desc),
1242 hip::getNumChannels(*desc),
1243 flags};
1244 if (!hip::CheckArrayFormat(*desc)) {
1245 return hipErrorInvalidValue;
1246 }
1247 HIP_RETURN(ihipArrayCreate(array, &allocateArray, 0 /* numMipLevels */));
1248}
1249
1250hipError_t hipArray3DCreate(hipArray_t* array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray) {
1251 HIP_INIT_API(hipArray3DCreate, array, pAllocateArray);

Callers

nothing calls this directly

Calls 4

getArrayFormatFunction · 0.85
getNumChannelsFunction · 0.85
CheckArrayFormatFunction · 0.85
ihipArrayCreateFunction · 0.85

Tested by

no test coverage detected