[GPU] Add additional condition for VA surface buffers detection (#13691)

This commit is contained in:
Sergey Shlyapnikov 2022-10-28 19:19:02 +04:00 committed by GitHub
parent cd76557df5
commit 6c6b3666a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -724,21 +724,26 @@ void network::execute_impl(const std::vector<event::ptr>& events) {
GPU_DEBUG_COUT << "----------------------------------------------" << std::endl;
std::vector<memory::ptr> in_out_mem;
auto is_surface_lock_check_needed = [&](const shared_mem_type& shared_mem_type) {
return shared_mem_type == shared_mem_type::shared_mem_vasurface ||
shared_mem_type == shared_mem_type::shared_mem_dxbuffer ||
shared_mem_type == shared_mem_type::shared_mem_image;
};
bool shared_mem_found = std::any_of(_in_out_shared_mem_types.begin(),
_in_out_shared_mem_types.end(),
[](const shared_mem_type& shared_mem_type) {
return shared_mem_type == shared_mem_type::shared_mem_vasurface ||
shared_mem_type == shared_mem_type::shared_mem_dxbuffer;
});
is_surface_lock_check_needed);
if (shared_mem_found) {
for (auto& inst : _inputs) {
if (inst->output_memory_ptr())
if (inst->output_memory_ptr() &&
is_surface_lock_check_needed(inst->output_memory_ptr()->get_internal_params().mem_type))
in_out_mem.push_back(inst->output_memory_ptr());
}
for (auto& inst : _outputs) {
if (inst->output_memory_ptr())
if (inst->output_memory_ptr() &&
is_surface_lock_check_needed(inst->output_memory_ptr()->get_internal_params().mem_type))
in_out_mem.push_back(inst->output_memory_ptr());
}
}