blob: 9a22490383284c8289e7817ff32caab5737e7ae0 [file] [log] [blame]
Michael Butler20f28a22019-04-26 17:46:08 -07001/*
Michael Butler0a1ad962019-04-30 13:51:24 -07002 * Copyright (C) 2019 The Android Open Source Project
Michael Butler20f28a22019-04-26 17:46:08 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "neuralnetworks_hidl_hal_test"
18
19#include "VtsHalNeuralnetworks.h"
20
Slava Shklyaev1d6b4652019-05-14 14:15:14 +010021#include "1.2/Callbacks.h"
Michael Butler20f28a22019-04-26 17:46:08 -070022#include "ExecutionBurstController.h"
23#include "ExecutionBurstServer.h"
Xusong Wang9e2b97b2019-08-23 16:10:54 -070024#include "GeneratedTestHarness.h"
Michael Butler20f28a22019-04-26 17:46:08 -070025#include "TestHarness.h"
26#include "Utils.h"
27
28#include <android-base/logging.h>
Michael Butler57568872019-07-25 17:22:11 -070029#include <chrono>
Michael Butlerddb770f2019-05-02 18:16:13 -070030#include <cstring>
Michael Butler20f28a22019-04-26 17:46:08 -070031
Michael Butlerbbe5dad2019-08-26 23:55:47 -070032namespace android::hardware::neuralnetworks::V1_2::vts::functional {
Michael Butler20f28a22019-04-26 17:46:08 -070033
Michael Butlerbbe5dad2019-08-26 23:55:47 -070034using nn::ExecutionBurstController;
35using nn::RequestChannelSender;
36using nn::ResultChannelReceiver;
37using V1_0::ErrorStatus;
38using V1_0::Request;
39using ExecutionBurstCallback = ExecutionBurstController::ExecutionBurstCallback;
Michael Butler20f28a22019-04-26 17:46:08 -070040
Michael Butlerda1a6922020-03-11 18:45:45 -070041using BurstExecutionMutation = std::function<void(std::vector<FmqRequestDatum>*)>;
42
Michael Butler0a1ad962019-04-30 13:51:24 -070043// This constant value represents the length of an FMQ that is large enough to
44// return a result from a burst execution for all of the generated test cases.
Michael Butler20f28a22019-04-26 17:46:08 -070045constexpr size_t kExecutionBurstChannelLength = 1024;
Michael Butler0a1ad962019-04-30 13:51:24 -070046
47// This constant value represents a length of an FMQ that is not large enough
48// to return a result from a burst execution for some of the generated test
49// cases.
Michael Butler20f28a22019-04-26 17:46:08 -070050constexpr size_t kExecutionBurstChannelSmallLength = 8;
51
52///////////////////////// UTILITY FUNCTIONS /////////////////////////
53
54static bool badTiming(Timing timing) {
55 return timing.timeOnDevice == UINT64_MAX && timing.timeInDriver == UINT64_MAX;
56}
57
58static void createBurst(const sp<IPreparedModel>& preparedModel, const sp<IBurstCallback>& callback,
59 std::unique_ptr<RequestChannelSender>* sender,
60 std::unique_ptr<ResultChannelReceiver>* receiver,
Michael Butler0a1ad962019-04-30 13:51:24 -070061 sp<IBurstContext>* context,
62 size_t resultChannelLength = kExecutionBurstChannelLength) {
Michael Butler20f28a22019-04-26 17:46:08 -070063 ASSERT_NE(nullptr, preparedModel.get());
64 ASSERT_NE(nullptr, sender);
65 ASSERT_NE(nullptr, receiver);
66 ASSERT_NE(nullptr, context);
67
68 // create FMQ objects
69 auto [fmqRequestChannel, fmqRequestDescriptor] =
Michael Butler57568872019-07-25 17:22:11 -070070 RequestChannelSender::create(kExecutionBurstChannelLength);
Michael Butler20f28a22019-04-26 17:46:08 -070071 auto [fmqResultChannel, fmqResultDescriptor] =
Michael Butler57568872019-07-25 17:22:11 -070072 ResultChannelReceiver::create(resultChannelLength, std::chrono::microseconds{0});
Michael Butler20f28a22019-04-26 17:46:08 -070073 ASSERT_NE(nullptr, fmqRequestChannel.get());
74 ASSERT_NE(nullptr, fmqResultChannel.get());
75 ASSERT_NE(nullptr, fmqRequestDescriptor);
76 ASSERT_NE(nullptr, fmqResultDescriptor);
77
78 // configure burst
79 ErrorStatus errorStatus;
80 sp<IBurstContext> burstContext;
81 const Return<void> ret = preparedModel->configureExecutionBurst(
82 callback, *fmqRequestDescriptor, *fmqResultDescriptor,
83 [&errorStatus, &burstContext](ErrorStatus status, const sp<IBurstContext>& context) {
84 errorStatus = status;
85 burstContext = context;
86 });
87 ASSERT_TRUE(ret.isOk());
88 ASSERT_EQ(ErrorStatus::NONE, errorStatus);
89 ASSERT_NE(nullptr, burstContext.get());
90
91 // return values
92 *sender = std::move(fmqRequestChannel);
93 *receiver = std::move(fmqResultChannel);
94 *context = burstContext;
95}
96
97static void createBurstWithResultChannelLength(
Michael Butler0a1ad962019-04-30 13:51:24 -070098 const sp<IPreparedModel>& preparedModel, size_t resultChannelLength,
99 std::shared_ptr<ExecutionBurstController>* controller) {
Michael Butler20f28a22019-04-26 17:46:08 -0700100 ASSERT_NE(nullptr, preparedModel.get());
101 ASSERT_NE(nullptr, controller);
102
103 // create FMQ objects
Michael Butler0a1ad962019-04-30 13:51:24 -0700104 std::unique_ptr<RequestChannelSender> sender;
105 std::unique_ptr<ResultChannelReceiver> receiver;
Michael Butler20f28a22019-04-26 17:46:08 -0700106 sp<ExecutionBurstCallback> callback = new ExecutionBurstCallback();
Michael Butler0a1ad962019-04-30 13:51:24 -0700107 sp<IBurstContext> context;
108 ASSERT_NO_FATAL_FAILURE(createBurst(preparedModel, callback, &sender, &receiver, &context,
109 resultChannelLength));
110 ASSERT_NE(nullptr, sender.get());
111 ASSERT_NE(nullptr, receiver.get());
112 ASSERT_NE(nullptr, context.get());
Michael Butler20f28a22019-04-26 17:46:08 -0700113
114 // return values
Michael Butler0a1ad962019-04-30 13:51:24 -0700115 *controller = std::make_shared<ExecutionBurstController>(std::move(sender), std::move(receiver),
116 context, callback);
Michael Butler20f28a22019-04-26 17:46:08 -0700117}
118
119// Primary validation function. This function will take a valid serialized
120// request, apply a mutation to it to invalidate the serialized request, then
Michael Butlerda1a6922020-03-11 18:45:45 -0700121// pass it to interface calls that use the serialized request.
Michael Butler20f28a22019-04-26 17:46:08 -0700122static void validate(RequestChannelSender* sender, ResultChannelReceiver* receiver,
Michael Butlerda1a6922020-03-11 18:45:45 -0700123 const std::string& message,
124 const std::vector<FmqRequestDatum>& originalSerialized,
125 const BurstExecutionMutation& mutate) {
126 std::vector<FmqRequestDatum> serialized = originalSerialized;
127 mutate(&serialized);
Michael Butler20f28a22019-04-26 17:46:08 -0700128
129 // skip if packet is too large to send
130 if (serialized.size() > kExecutionBurstChannelLength) {
131 return;
132 }
133
134 SCOPED_TRACE(message);
135
136 // send invalid packet
Michael Butler0a1ad962019-04-30 13:51:24 -0700137 ASSERT_TRUE(sender->sendPacket(serialized));
Michael Butler20f28a22019-04-26 17:46:08 -0700138
139 // receive error
140 auto results = receiver->getBlocking();
141 ASSERT_TRUE(results.has_value());
142 const auto [status, outputShapes, timing] = std::move(*results);
143 EXPECT_NE(ErrorStatus::NONE, status);
144 EXPECT_EQ(0u, outputShapes.size());
145 EXPECT_TRUE(badTiming(timing));
146}
147
Michael Butler0a1ad962019-04-30 13:51:24 -0700148// For validation, valid packet entries are mutated to invalid packet entries,
149// or invalid packet entries are inserted into valid packets. This function
150// creates pre-set invalid packet entries for convenience.
151static std::vector<FmqRequestDatum> createBadRequestPacketEntries() {
Michael Butler20f28a22019-04-26 17:46:08 -0700152 const FmqRequestDatum::PacketInformation packetInformation = {
153 /*.packetSize=*/10, /*.numberOfInputOperands=*/10, /*.numberOfOutputOperands=*/10,
154 /*.numberOfPools=*/10};
155 const FmqRequestDatum::OperandInformation operandInformation = {
156 /*.hasNoValue=*/false, /*.location=*/{}, /*.numberOfDimensions=*/10};
157 const int32_t invalidPoolIdentifier = std::numeric_limits<int32_t>::max();
Michael Butler0a1ad962019-04-30 13:51:24 -0700158 std::vector<FmqRequestDatum> bad(7);
159 bad[0].packetInformation(packetInformation);
160 bad[1].inputOperandInformation(operandInformation);
161 bad[2].inputOperandDimensionValue(0);
162 bad[3].outputOperandInformation(operandInformation);
163 bad[4].outputOperandDimensionValue(0);
164 bad[5].poolIdentifier(invalidPoolIdentifier);
165 bad[6].measureTiming(MeasureTiming::YES);
166 return bad;
Michael Butler20f28a22019-04-26 17:46:08 -0700167}
168
Michael Butler0a1ad962019-04-30 13:51:24 -0700169// For validation, valid packet entries are mutated to invalid packet entries,
170// or invalid packet entries are inserted into valid packets. This function
171// retrieves pre-set invalid packet entries for convenience. This function
172// caches these data so they can be reused on subsequent validation checks.
173static const std::vector<FmqRequestDatum>& getBadRequestPacketEntries() {
174 static const std::vector<FmqRequestDatum> bad = createBadRequestPacketEntries();
175 return bad;
Michael Butler20f28a22019-04-26 17:46:08 -0700176}
177
178///////////////////////// REMOVE DATUM ////////////////////////////////////
179
180static void removeDatumTest(RequestChannelSender* sender, ResultChannelReceiver* receiver,
181 const std::vector<FmqRequestDatum>& serialized) {
182 for (size_t index = 0; index < serialized.size(); ++index) {
183 const std::string message = "removeDatum: removed datum at index " + std::to_string(index);
184 validate(sender, receiver, message, serialized,
185 [index](std::vector<FmqRequestDatum>* serialized) {
186 serialized->erase(serialized->begin() + index);
187 });
188 }
189}
190
191///////////////////////// ADD DATUM ////////////////////////////////////
192
193static void addDatumTest(RequestChannelSender* sender, ResultChannelReceiver* receiver,
194 const std::vector<FmqRequestDatum>& serialized) {
Michael Butler0a1ad962019-04-30 13:51:24 -0700195 const std::vector<FmqRequestDatum>& extra = getBadRequestPacketEntries();
Michael Butler20f28a22019-04-26 17:46:08 -0700196 for (size_t index = 0; index <= serialized.size(); ++index) {
197 for (size_t type = 0; type < extra.size(); ++type) {
198 const std::string message = "addDatum: added datum type " + std::to_string(type) +
199 " at index " + std::to_string(index);
200 validate(sender, receiver, message, serialized,
201 [index, type, &extra](std::vector<FmqRequestDatum>* serialized) {
202 serialized->insert(serialized->begin() + index, extra[type]);
203 });
204 }
205 }
206}
207
208///////////////////////// MUTATE DATUM ////////////////////////////////////
209
210static bool interestingCase(const FmqRequestDatum& lhs, const FmqRequestDatum& rhs) {
211 using Discriminator = FmqRequestDatum::hidl_discriminator;
212
213 const bool differentValues = (lhs != rhs);
Michael Butler0a1ad962019-04-30 13:51:24 -0700214 const bool sameDiscriminator = (lhs.getDiscriminator() == rhs.getDiscriminator());
Michael Butler20f28a22019-04-26 17:46:08 -0700215 const auto discriminator = rhs.getDiscriminator();
216 const bool isDimensionValue = (discriminator == Discriminator::inputOperandDimensionValue ||
217 discriminator == Discriminator::outputOperandDimensionValue);
218
Michael Butler0a1ad962019-04-30 13:51:24 -0700219 return differentValues && !(sameDiscriminator && isDimensionValue);
Michael Butler20f28a22019-04-26 17:46:08 -0700220}
221
222static void mutateDatumTest(RequestChannelSender* sender, ResultChannelReceiver* receiver,
223 const std::vector<FmqRequestDatum>& serialized) {
Michael Butler0a1ad962019-04-30 13:51:24 -0700224 const std::vector<FmqRequestDatum>& change = getBadRequestPacketEntries();
Michael Butler20f28a22019-04-26 17:46:08 -0700225 for (size_t index = 0; index < serialized.size(); ++index) {
226 for (size_t type = 0; type < change.size(); ++type) {
227 if (interestingCase(serialized[index], change[type])) {
228 const std::string message = "mutateDatum: changed datum at index " +
229 std::to_string(index) + " to datum type " +
230 std::to_string(type);
231 validate(sender, receiver, message, serialized,
232 [index, type, &change](std::vector<FmqRequestDatum>* serialized) {
233 (*serialized)[index] = change[type];
234 });
235 }
236 }
237 }
238}
239
240///////////////////////// BURST VALIATION TESTS ////////////////////////////////////
241
242static void validateBurstSerialization(const sp<IPreparedModel>& preparedModel,
Xusong Wang491b0a82019-08-09 16:45:24 -0700243 const Request& request) {
Michael Butler20f28a22019-04-26 17:46:08 -0700244 // create burst
245 std::unique_ptr<RequestChannelSender> sender;
246 std::unique_ptr<ResultChannelReceiver> receiver;
247 sp<ExecutionBurstCallback> callback = new ExecutionBurstCallback();
248 sp<IBurstContext> context;
249 ASSERT_NO_FATAL_FAILURE(createBurst(preparedModel, callback, &sender, &receiver, &context));
250 ASSERT_NE(nullptr, sender.get());
251 ASSERT_NE(nullptr, receiver.get());
252 ASSERT_NE(nullptr, context.get());
253
Xusong Wang491b0a82019-08-09 16:45:24 -0700254 // load memory into callback slots
255 std::vector<intptr_t> keys;
256 keys.reserve(request.pools.size());
257 std::transform(request.pools.begin(), request.pools.end(), std::back_inserter(keys),
258 [](const auto& pool) { return reinterpret_cast<intptr_t>(&pool); });
259 const std::vector<int32_t> slots = callback->getSlots(request.pools, keys);
Michael Butler20f28a22019-04-26 17:46:08 -0700260
Xusong Wang491b0a82019-08-09 16:45:24 -0700261 // ensure slot std::numeric_limits<int32_t>::max() doesn't exist (for
262 // subsequent slot validation testing)
263 ASSERT_TRUE(std::all_of(slots.begin(), slots.end(), [](int32_t slot) {
264 return slot != std::numeric_limits<int32_t>::max();
265 }));
Michael Butler20f28a22019-04-26 17:46:08 -0700266
Xusong Wang491b0a82019-08-09 16:45:24 -0700267 // serialize the request
Michael Butler7076f622019-08-29 11:08:25 -0700268 const auto serialized = android::nn::serialize(request, MeasureTiming::YES, slots);
Michael Butler20f28a22019-04-26 17:46:08 -0700269
Xusong Wang491b0a82019-08-09 16:45:24 -0700270 // validations
271 removeDatumTest(sender.get(), receiver.get(), serialized);
272 addDatumTest(sender.get(), receiver.get(), serialized);
273 mutateDatumTest(sender.get(), receiver.get(), serialized);
Michael Butler20f28a22019-04-26 17:46:08 -0700274}
275
Michael Butler0a1ad962019-04-30 13:51:24 -0700276// This test validates that when the Result message size exceeds length of the
277// result FMQ, the service instance gracefully fails and returns an error.
Michael Butler20f28a22019-04-26 17:46:08 -0700278static void validateBurstFmqLength(const sp<IPreparedModel>& preparedModel,
Xusong Wang491b0a82019-08-09 16:45:24 -0700279 const Request& request) {
Michael Butler20f28a22019-04-26 17:46:08 -0700280 // create regular burst
281 std::shared_ptr<ExecutionBurstController> controllerRegular;
Michael Butler0a1ad962019-04-30 13:51:24 -0700282 ASSERT_NO_FATAL_FAILURE(createBurstWithResultChannelLength(
283 preparedModel, kExecutionBurstChannelLength, &controllerRegular));
Michael Butler20f28a22019-04-26 17:46:08 -0700284 ASSERT_NE(nullptr, controllerRegular.get());
285
286 // create burst with small output channel
287 std::shared_ptr<ExecutionBurstController> controllerSmall;
Michael Butler0a1ad962019-04-30 13:51:24 -0700288 ASSERT_NO_FATAL_FAILURE(createBurstWithResultChannelLength(
289 preparedModel, kExecutionBurstChannelSmallLength, &controllerSmall));
Michael Butler20f28a22019-04-26 17:46:08 -0700290 ASSERT_NE(nullptr, controllerSmall.get());
291
Xusong Wang491b0a82019-08-09 16:45:24 -0700292 // load memory into callback slots
293 std::vector<intptr_t> keys(request.pools.size());
294 for (size_t i = 0; i < keys.size(); ++i) {
295 keys[i] = reinterpret_cast<intptr_t>(&request.pools[i]);
Michael Butler20f28a22019-04-26 17:46:08 -0700296 }
Xusong Wang491b0a82019-08-09 16:45:24 -0700297
298 // collect serialized result by running regular burst
Michael Butler57568872019-07-25 17:22:11 -0700299 const auto [nRegular, outputShapesRegular, timingRegular, fallbackRegular] =
Xusong Wang491b0a82019-08-09 16:45:24 -0700300 controllerRegular->compute(request, MeasureTiming::NO, keys);
Michael Butler9449a282019-12-11 19:08:08 -0800301 const ErrorStatus statusRegular =
302 nn::convertToV1_0(nn::convertResultCodeToErrorStatus(nRegular));
Michael Butler57568872019-07-25 17:22:11 -0700303 EXPECT_FALSE(fallbackRegular);
Xusong Wang491b0a82019-08-09 16:45:24 -0700304
305 // skip test if regular burst output isn't useful for testing a failure
306 // caused by having too small of a length for the result FMQ
307 const std::vector<FmqResultDatum> serialized =
Michael Butler7076f622019-08-29 11:08:25 -0700308 android::nn::serialize(statusRegular, outputShapesRegular, timingRegular);
Xusong Wang491b0a82019-08-09 16:45:24 -0700309 if (statusRegular != ErrorStatus::NONE ||
310 serialized.size() <= kExecutionBurstChannelSmallLength) {
311 return;
312 }
313
314 // by this point, execution should fail because the result channel isn't
315 // large enough to return the serialized result
Michael Butler57568872019-07-25 17:22:11 -0700316 const auto [nSmall, outputShapesSmall, timingSmall, fallbackSmall] =
Xusong Wang491b0a82019-08-09 16:45:24 -0700317 controllerSmall->compute(request, MeasureTiming::NO, keys);
Michael Butler9449a282019-12-11 19:08:08 -0800318 const ErrorStatus statusSmall = nn::convertToV1_0(nn::convertResultCodeToErrorStatus(nSmall));
Xusong Wang491b0a82019-08-09 16:45:24 -0700319 EXPECT_NE(ErrorStatus::NONE, statusSmall);
320 EXPECT_EQ(0u, outputShapesSmall.size());
321 EXPECT_TRUE(badTiming(timingSmall));
Michael Butler57568872019-07-25 17:22:11 -0700322 EXPECT_FALSE(fallbackSmall);
Michael Butler20f28a22019-04-26 17:46:08 -0700323}
324
Michael Butlerddb770f2019-05-02 18:16:13 -0700325static bool isSanitized(const FmqResultDatum& datum) {
326 using Discriminator = FmqResultDatum::hidl_discriminator;
327
328 // check to ensure the padding values in the returned
329 // FmqResultDatum::OperandInformation are initialized to 0
330 if (datum.getDiscriminator() == Discriminator::operandInformation) {
331 static_assert(
332 offsetof(FmqResultDatum::OperandInformation, isSufficient) == 0,
333 "unexpected value for offset of FmqResultDatum::OperandInformation::isSufficient");
334 static_assert(
335 sizeof(FmqResultDatum::OperandInformation::isSufficient) == 1,
336 "unexpected value for size of FmqResultDatum::OperandInformation::isSufficient");
337 static_assert(offsetof(FmqResultDatum::OperandInformation, numberOfDimensions) == 4,
338 "unexpected value for offset of "
339 "FmqResultDatum::OperandInformation::numberOfDimensions");
340 static_assert(sizeof(FmqResultDatum::OperandInformation::numberOfDimensions) == 4,
341 "unexpected value for size of "
342 "FmqResultDatum::OperandInformation::numberOfDimensions");
343 static_assert(sizeof(FmqResultDatum::OperandInformation) == 8,
344 "unexpected value for size of "
345 "FmqResultDatum::OperandInformation");
346
347 constexpr size_t paddingOffset =
348 offsetof(FmqResultDatum::OperandInformation, isSufficient) +
349 sizeof(FmqResultDatum::OperandInformation::isSufficient);
350 constexpr size_t paddingSize =
351 offsetof(FmqResultDatum::OperandInformation, numberOfDimensions) - paddingOffset;
352
353 FmqResultDatum::OperandInformation initialized{};
354 std::memset(&initialized, 0, sizeof(initialized));
355
356 const char* initializedPaddingStart =
357 reinterpret_cast<const char*>(&initialized) + paddingOffset;
358 const char* datumPaddingStart =
359 reinterpret_cast<const char*>(&datum.operandInformation()) + paddingOffset;
360
361 return std::memcmp(datumPaddingStart, initializedPaddingStart, paddingSize) == 0;
362 }
363
364 // there are no other padding initialization checks required, so return true
365 // for any sum-type that isn't FmqResultDatum::OperandInformation
366 return true;
367}
368
369static void validateBurstSanitized(const sp<IPreparedModel>& preparedModel,
Xusong Wang8fc46222019-08-19 10:37:18 -0700370 const Request& request) {
Michael Butlerddb770f2019-05-02 18:16:13 -0700371 // create burst
372 std::unique_ptr<RequestChannelSender> sender;
373 std::unique_ptr<ResultChannelReceiver> receiver;
374 sp<ExecutionBurstCallback> callback = new ExecutionBurstCallback();
375 sp<IBurstContext> context;
376 ASSERT_NO_FATAL_FAILURE(createBurst(preparedModel, callback, &sender, &receiver, &context));
377 ASSERT_NE(nullptr, sender.get());
378 ASSERT_NE(nullptr, receiver.get());
379 ASSERT_NE(nullptr, context.get());
380
Xusong Wang8fc46222019-08-19 10:37:18 -0700381 // load memory into callback slots
382 std::vector<intptr_t> keys;
383 keys.reserve(request.pools.size());
384 std::transform(request.pools.begin(), request.pools.end(), std::back_inserter(keys),
385 [](const auto& pool) { return reinterpret_cast<intptr_t>(&pool); });
386 const std::vector<int32_t> slots = callback->getSlots(request.pools, keys);
Michael Butlerddb770f2019-05-02 18:16:13 -0700387
Xusong Wang8fc46222019-08-19 10:37:18 -0700388 // send valid request
389 ASSERT_TRUE(sender->send(request, MeasureTiming::YES, slots));
Michael Butlerddb770f2019-05-02 18:16:13 -0700390
Xusong Wang8fc46222019-08-19 10:37:18 -0700391 // receive valid result
392 auto serialized = receiver->getPacketBlocking();
393 ASSERT_TRUE(serialized.has_value());
Michael Butlerddb770f2019-05-02 18:16:13 -0700394
Xusong Wang8fc46222019-08-19 10:37:18 -0700395 // sanitize result
396 ASSERT_TRUE(std::all_of(serialized->begin(), serialized->end(), isSanitized))
397 << "The result serialized data is not properly sanitized";
Michael Butlerddb770f2019-05-02 18:16:13 -0700398}
399
Michael Butler20f28a22019-04-26 17:46:08 -0700400///////////////////////////// ENTRY POINT //////////////////////////////////
401
Michael Butlere16af0a2019-08-29 22:17:24 -0700402void validateBurst(const sp<IPreparedModel>& preparedModel, const Request& request) {
Xusong Wang491b0a82019-08-09 16:45:24 -0700403 ASSERT_NO_FATAL_FAILURE(validateBurstSerialization(preparedModel, request));
404 ASSERT_NO_FATAL_FAILURE(validateBurstFmqLength(preparedModel, request));
Xusong Wang8fc46222019-08-19 10:37:18 -0700405 ASSERT_NO_FATAL_FAILURE(validateBurstSanitized(preparedModel, request));
Michael Butler20f28a22019-04-26 17:46:08 -0700406}
407
Michael Butlerbbe5dad2019-08-26 23:55:47 -0700408} // namespace android::hardware::neuralnetworks::V1_2::vts::functional