aboutsummaryrefslogtreecommitdiff
path: root/test/DriverTestHelpers.hpp
diff options
context:
space:
mode:
authorKevin May <kevin.may@arm.com>2019-03-14 11:56:32 +0000
committerÁron Virginás-Tar <aron.virginas-tar@arm.com>2019-03-15 10:56:29 +0000
commitf29a2c55af463141fac7c92042bfdb9f00ba4ccd (patch)
tree675816444109edc6af2268d407e6e61971485841 /test/DriverTestHelpers.hpp
parent7bac1d7e8a7bf82d7c481cf05e31ae76f91725a6 (diff)
downloadandroid-nn-driver-f29a2c55af463141fac7c92042bfdb9f00ba4ccd.tar.gz
MLCE-91 LSTM doesn't support optional input
* Add fix for optional NO_VALUE operands in ConversionUtils.hpp * Remove fail message for optional NO_VALUE in ConversionUtils.hpp * Add to existing tests and test helper to cover optional NO_VALUE Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: Icf36af1fc00d3fb33cdd77ff6d6618cc4700d3fd
Diffstat (limited to 'test/DriverTestHelpers.hpp')
-rw-r--r--test/DriverTestHelpers.hpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/DriverTestHelpers.hpp b/test/DriverTestHelpers.hpp
index 4d91ae22..394720ed 100644
--- a/test/DriverTestHelpers.hpp
+++ b/test/DriverTestHelpers.hpp
@@ -112,7 +112,8 @@ template<typename HalModel, typename T>
void AddTensorOperand(HalModel& model,
const hidl_vec<uint32_t>& dimensions,
const T* values,
- OperandType operandType = OperandType::TENSOR_FLOAT32)
+ OperandType operandType = OperandType::TENSOR_FLOAT32,
+ OperandLifeTime operandLifeTime = OperandLifeTime::CONSTANT_COPY)
{
uint32_t totalElements = 1;
for (uint32_t dim : dimensions)
@@ -121,9 +122,13 @@ void AddTensorOperand(HalModel& model,
}
DataLocation location = {};
- location.offset = model.operandValues.size();
location.length = totalElements * sizeof(T);
+ if(operandLifeTime == OperandLifeTime::CONSTANT_COPY)
+ {
+ location.offset = model.operandValues.size();
+ }
+
Operand op = {};
op.type = operandType;
op.dimensions = dimensions;
@@ -143,9 +148,10 @@ template<typename HalModel, typename T>
void AddTensorOperand(HalModel& model,
const hidl_vec<uint32_t>& dimensions,
const std::vector<T>& values,
- OperandType operandType = OperandType::TENSOR_FLOAT32)
+ OperandType operandType = OperandType::TENSOR_FLOAT32,
+ OperandLifeTime operandLifeTime = OperandLifeTime::CONSTANT_COPY)
{
- AddTensorOperand<HalModel, T>(model, dimensions, values.data(), operandType);
+ AddTensorOperand<HalModel, T>(model, dimensions, values.data(), operandType, operandLifeTime);
}
template<typename HalModel>