@@ -312,7 +312,8 @@ TEST(MediaTek, DispatchApiWithAhwb) {
312312 {
313313 ABSL_LOG (INFO) << " Checking output..." ;
314314 void * host_mem_addr;
315- ASSERT_EQ (LiteRtLockTensorBuffer (output_tensor_buffer, &host_mem_addr),
315+ ASSERT_EQ (LiteRtLockTensorBuffer (output_tensor_buffer, &host_mem_addr,
316+ kLiteRtTensorBufferLockModeRead ),
316317 kLiteRtStatusOk );
317318 auto output = absl::MakeSpan (static_cast <const float *>(host_mem_addr),
318319 kTestOutputSize );
@@ -543,12 +544,14 @@ TEST(MediaTek, DispatchApiWithDmaBuf) {
543544 ABSL_LOG (INFO) << " Filling inputs with data" ;
544545 void * host_mem_addr;
545546
546- ASSERT_EQ (LiteRtLockTensorBuffer (input_0_tensor_buffer, &host_mem_addr),
547+ ASSERT_EQ (LiteRtLockTensorBuffer (input_0_tensor_buffer, &host_mem_addr,
548+ kLiteRtTensorBufferLockModeRead ),
547549 kLiteRtStatusOk );
548550 std::memcpy (host_mem_addr, kTestInput0Tensor , sizeof (kTestInput0Tensor ));
549551 ASSERT_EQ (LiteRtUnlockTensorBuffer (input_0_tensor_buffer), kLiteRtStatusOk );
550552
551- ASSERT_EQ (LiteRtLockTensorBuffer (input_1_tensor_buffer, &host_mem_addr),
553+ ASSERT_EQ (LiteRtLockTensorBuffer (input_1_tensor_buffer, &host_mem_addr,
554+ kLiteRtTensorBufferLockModeRead ),
552555 kLiteRtStatusOk );
553556 std::memcpy (host_mem_addr, kTestInput1Tensor , sizeof (kTestInput1Tensor ));
554557 ASSERT_EQ (LiteRtUnlockTensorBuffer (input_1_tensor_buffer), kLiteRtStatusOk );
@@ -568,7 +571,8 @@ TEST(MediaTek, DispatchApiWithDmaBuf) {
568571 {
569572 ABSL_LOG (INFO) << " Checking output..." ;
570573 void * host_mem_addr;
571- ASSERT_EQ (LiteRtLockTensorBuffer (output_tensor_buffer, &host_mem_addr),
574+ ASSERT_EQ (LiteRtLockTensorBuffer (output_tensor_buffer, &host_mem_addr,
575+ kLiteRtTensorBufferLockModeRead ),
572576 kLiteRtStatusOk );
573577 auto output = absl::MakeSpan (static_cast <const float *>(host_mem_addr),
574578 kTestOutputSize );
@@ -587,13 +591,15 @@ TEST(MediaTek, DispatchApiWithDmaBuf) {
587591 ABSL_LOG (INFO) << " Filling inputs with data" ;
588592 void * host_mem_addr;
589593
590- ASSERT_EQ (LiteRtLockTensorBuffer (input_0_tensor_buffer, &host_mem_addr),
594+ ASSERT_EQ (LiteRtLockTensorBuffer (input_0_tensor_buffer, &host_mem_addr,
595+ kLiteRtTensorBufferLockModeRead ),
591596 kLiteRtStatusOk );
592597 std::memcpy (host_mem_addr, kTestInput0Tensor_2 ,
593598 sizeof (kTestInput0Tensor_2 ));
594599 ASSERT_EQ (LiteRtUnlockTensorBuffer (input_0_tensor_buffer), kLiteRtStatusOk );
595600
596- ASSERT_EQ (LiteRtLockTensorBuffer (input_1_tensor_buffer, &host_mem_addr),
601+ ASSERT_EQ (LiteRtLockTensorBuffer (input_1_tensor_buffer, &host_mem_addr,
602+ kLiteRtTensorBufferLockModeRead ),
597603 kLiteRtStatusOk );
598604 std::memcpy (host_mem_addr, kTestInput1Tensor_2 ,
599605 sizeof (kTestInput1Tensor_2 ));
@@ -614,7 +620,8 @@ TEST(MediaTek, DispatchApiWithDmaBuf) {
614620 {
615621 ABSL_LOG (INFO) << " Checking output..." ;
616622 void * host_mem_addr;
617- ASSERT_EQ (LiteRtLockTensorBuffer (output_tensor_buffer, &host_mem_addr),
623+ ASSERT_EQ (LiteRtLockTensorBuffer (output_tensor_buffer, &host_mem_addr,
624+ kLiteRtTensorBufferLockModeRead ),
618625 kLiteRtStatusOk );
619626 auto output = absl::MakeSpan (static_cast <const float *>(host_mem_addr),
620627 kTestOutputSize );
0 commit comments