Tensor1: memorize size_alignment when tracking the ahwb usage.
When CPU/GPU buffer allocated and the tracker selects Ahwb storage to be used then the properly recorded alignment must be used. PiperOrigin-RevId: 498264759
This commit is contained in:
committed by
Copybara-Service
parent
1924f1cdff
commit
2d9a969d10
@@ -266,7 +266,12 @@ Tensor::AHardwareBufferView Tensor::GetAHardwareBufferWriteView(
|
||||
|
||||
bool Tensor::AllocateAHardwareBuffer(int size_alignment) const {
|
||||
// Mark current tracking key as Ahwb-use.
|
||||
ahwb_usage_track_.insert(ahwb_tracking_key_);
|
||||
if (auto it = ahwb_usage_track_.find(ahwb_tracking_key_);
|
||||
it != ahwb_usage_track_.end()) {
|
||||
size_alignment = it->second;
|
||||
} else if (ahwb_tracking_key_ != 0) {
|
||||
ahwb_usage_track_.insert({ahwb_tracking_key_, size_alignment});
|
||||
}
|
||||
use_ahwb_ = true;
|
||||
|
||||
if (__builtin_available(android 26, *)) {
|
||||
|
||||
Reference in New Issue
Block a user