[GPU] Fix for typo (#12732)
This commit is contained in:
parent
dc7f8249a7
commit
5cf1b0a124
@ -83,7 +83,7 @@ public:
|
|||||||
virtual allocation_type get_default_allocation_type() const = 0;
|
virtual allocation_type get_default_allocation_type() const = 0;
|
||||||
|
|
||||||
/// Returns preferred allocation type which can be mapped to host ptr
|
/// Returns preferred allocation type which can be mapped to host ptr
|
||||||
allocation_type get_lockable_preffered_memory_allocation_type(bool is_image_layout = false) const;
|
allocation_type get_lockable_preferred_memory_allocation_type(bool is_image_layout = false) const;
|
||||||
|
|
||||||
/// Checks if the current engine supports speicied allocation @p type
|
/// Checks if the current engine supports speicied allocation @p type
|
||||||
bool supports_allocation(allocation_type type) const;
|
bool supports_allocation(allocation_type type) const;
|
||||||
|
@ -166,20 +166,20 @@ void add_required_reorders::run(program& p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!correct_layout_selected) {
|
if (!correct_layout_selected) {
|
||||||
std::vector<cldnn::format> preffered_layout_formats;
|
std::vector<cldnn::format> preferred_layout_formats;
|
||||||
size_t max_in_dims = std::max(cldnn::format::dimension(original_layout.format), static_cast<size_t>(4));
|
size_t max_in_dims = std::max(cldnn::format::dimension(original_layout.format), static_cast<size_t>(4));
|
||||||
for (auto& node : usr->get_dependencies()) {
|
for (auto& node : usr->get_dependencies()) {
|
||||||
if (format::is_weights_format(node->get_output_layout().format))
|
if (format::is_weights_format(node->get_output_layout().format))
|
||||||
continue;
|
continue;
|
||||||
max_in_dims = std::max(cldnn::format::dimension(node->get_output_layout().format), max_in_dims);
|
max_in_dims = std::max(cldnn::format::dimension(node->get_output_layout().format), max_in_dims);
|
||||||
}
|
}
|
||||||
// This list of preffered layouts has been selected arbitrary due to developers' experience
|
// This list of preferred layouts has been selected arbitrary due to developers' experience
|
||||||
if (max_in_dims == 5) {
|
if (max_in_dims == 5) {
|
||||||
preffered_layout_formats = {
|
preferred_layout_formats = {
|
||||||
cldnn::format::bfzyx,
|
cldnn::format::bfzyx,
|
||||||
};
|
};
|
||||||
} else if (max_in_dims == 4) {
|
} else if (max_in_dims == 4) {
|
||||||
preffered_layout_formats = {
|
preferred_layout_formats = {
|
||||||
cldnn::format::bfyx,
|
cldnn::format::bfyx,
|
||||||
cldnn::format::yxfb,
|
cldnn::format::yxfb,
|
||||||
cldnn::format::byxf,
|
cldnn::format::byxf,
|
||||||
@ -195,7 +195,7 @@ void add_required_reorders::run(program& p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!correct_layout_selected) {
|
if (!correct_layout_selected) {
|
||||||
for (auto new_layout_format : preffered_layout_formats) {
|
for (auto new_layout_format : preferred_layout_formats) {
|
||||||
layout current_layout(original_layout.data_type, new_layout_format, original_layout.get_tensor());
|
layout current_layout(original_layout.data_type, new_layout_format, original_layout.get_tensor());
|
||||||
usr->set_output_layout(current_layout, false);
|
usr->set_output_layout(current_layout, false);
|
||||||
if (usr->type()->does_possible_implementation_exist(*usr)) {
|
if (usr->type()->does_possible_implementation_exist(*usr)) {
|
||||||
@ -220,7 +220,7 @@ void add_required_reorders::run(program& p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!correct_layout_selected) {
|
if (!correct_layout_selected) {
|
||||||
for (auto new_layout_format : preffered_layout_formats) {
|
for (auto new_layout_format : preferred_layout_formats) {
|
||||||
layout current_layout_i32(original_layout_i32.data_type,
|
layout current_layout_i32(original_layout_i32.data_type,
|
||||||
new_layout_format,
|
new_layout_format,
|
||||||
original_layout_i32.get_tensor());
|
original_layout_i32.get_tensor());
|
||||||
|
@ -513,7 +513,7 @@ memory::ptr primitive_inst::allocate_output(engine& _engine, memory_pool& pool,
|
|||||||
auto use_lockable_memory = is_output_buffer(_node) || is_cpu || is_any_user_cpu(_node.get_users()) ||
|
auto use_lockable_memory = is_output_buffer(_node) || is_cpu || is_any_user_cpu(_node.get_users()) ||
|
||||||
!_engine.supports_allocation(allocation_type::usm_device);
|
!_engine.supports_allocation(allocation_type::usm_device);
|
||||||
GPU_DEBUG_GET_INSTANCE(debug_config);
|
GPU_DEBUG_GET_INSTANCE(debug_config);
|
||||||
const auto& lockable_mem_type = _engine.get_lockable_preffered_memory_allocation_type(layout.format.is_image_2d());
|
const auto& lockable_mem_type = _engine.get_lockable_preferred_memory_allocation_type(layout.format.is_image_2d());
|
||||||
const auto& alloc_type = use_lockable_memory ? lockable_mem_type
|
const auto& alloc_type = use_lockable_memory ? lockable_mem_type
|
||||||
: usm_device_allocatable ? allocation_type::usm_device : lockable_mem_type;
|
: usm_device_allocatable ? allocation_type::usm_device : lockable_mem_type;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ bool engine::supports_allocation(allocation_type type) const {
|
|||||||
return _device->get_mem_caps().support_allocation_type(type);
|
return _device->get_mem_caps().support_allocation_type(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
allocation_type engine::get_lockable_preffered_memory_allocation_type(bool is_image_layout) const {
|
allocation_type engine::get_lockable_preferred_memory_allocation_type(bool is_image_layout) const {
|
||||||
if (!use_unified_shared_memory() || is_image_layout)
|
if (!use_unified_shared_memory() || is_image_layout)
|
||||||
return get_default_allocation_type();
|
return get_default_allocation_type();
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ memory::ptr engine::attach_memory(const layout& layout, void* ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
memory::ptr engine::allocate_memory(const layout& layout, bool reset) {
|
memory::ptr engine::allocate_memory(const layout& layout, bool reset) {
|
||||||
allocation_type type = get_lockable_preffered_memory_allocation_type(layout.format.is_image_2d());
|
allocation_type type = get_lockable_preferred_memory_allocation_type(layout.format.is_image_2d());
|
||||||
return allocate_memory(layout, type, reset);
|
return allocate_memory(layout, type, reset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user