mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Fix NNAPI HIDL 1.3 VTS MemoryDomainExecutionTest" am: 97a7435d5f am: 3248647a41
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1936397 Change-Id: I68bb9009f4664c7a5cef859061dc1ff3becf5bb9
This commit is contained in:
@@ -1158,12 +1158,15 @@ TEST_P(MemoryDomainExecutionTest, InvalidDimensions) {
|
|||||||
auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}, kTestOperand.dimensions);
|
auto [buffer, token] = allocateBuffer(preparedModel, {0}, {0}, kTestOperand.dimensions);
|
||||||
if (buffer == nullptr) return;
|
if (buffer == nullptr) return;
|
||||||
|
|
||||||
Request::MemoryPool sharedMemory = createSharedMemoryPool(kTestOperandDataSize);
|
// Use an incompatible dimension and make sure the length matches with the bad dimension.
|
||||||
Request::MemoryPool deviceMemory = createDeviceMemoryPool(token);
|
|
||||||
auto badDimensions = kTestOperand.dimensions;
|
auto badDimensions = kTestOperand.dimensions;
|
||||||
badDimensions[0] = 2;
|
badDimensions[0] = 2;
|
||||||
|
const uint32_t badTestOperandDataSize = kTestOperandDataSize * 2;
|
||||||
|
|
||||||
|
Request::MemoryPool sharedMemory = createSharedMemoryPool(badTestOperandDataSize);
|
||||||
|
Request::MemoryPool deviceMemory = createDeviceMemoryPool(token);
|
||||||
RequestArgument sharedMemoryArg = {
|
RequestArgument sharedMemoryArg = {
|
||||||
.location = {.poolIndex = 0, .offset = 0, .length = kTestOperandDataSize},
|
.location = {.poolIndex = 0, .offset = 0, .length = badTestOperandDataSize},
|
||||||
.dimensions = badDimensions};
|
.dimensions = badDimensions};
|
||||||
RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}};
|
RequestArgument deviceMemoryArg = {.location = {.poolIndex = 1}};
|
||||||
RequestArgument deviceMemoryArgWithBadDimensions = {.location = {.poolIndex = 1},
|
RequestArgument deviceMemoryArgWithBadDimensions = {.location = {.poolIndex = 1},
|
||||||
|
|||||||
Reference in New Issue
Block a user