-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Resolve conflicts. - Change file location.
- Loading branch information
1 parent
dbd016c
commit 6d36bb5
Showing
13 changed files
with
152 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 4 additions & 14 deletions
18
inference-engine/thirdparty/clDNN/kernel_selector/core/cl_kernels/gather_elements_ref.cl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 0 additions & 95 deletions
95
inference-engine/thirdparty/clDNN/src/gpu/gather_elements_gpu.cpp
This file was deleted.
Oops, something went wrong.
86 changes: 86 additions & 0 deletions
86
inference-engine/thirdparty/clDNN/src/impls/ocl/gather_elements.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "gather_elements_inst.h" | ||
#include "primitive_base.hpp" | ||
#include "impls/implementation_map.hpp" | ||
#include "kernel_selector_helper.h" | ||
#include "gather/gather_elements_kernel_selector.h" | ||
#include "gather/gather_elements_kernel_ref.h" | ||
#include "cldnn/runtime/error_handler.hpp" | ||
|
||
using namespace cldnn; | ||
|
||
namespace cldnn { | ||
namespace ocl { | ||
kernel_selector::gather_elements_axis convert_axis(gather_elements::gather_elements_axis axis) { | ||
switch (axis) { | ||
case gather_elements::along_x: | ||
return kernel_selector::gather_elements_axis::X; | ||
case gather_elements::along_y: | ||
return kernel_selector::gather_elements_axis::Y; | ||
case gather_elements::along_z: | ||
return kernel_selector::gather_elements_axis::Z; | ||
case gather_elements::along_w: | ||
return kernel_selector::gather_elements_axis::W; | ||
case gather_elements::along_f: | ||
return kernel_selector::gather_elements_axis::FEATURE; | ||
case gather_elements::along_b: | ||
return kernel_selector::gather_elements_axis::BATCH; | ||
default: | ||
return kernel_selector::gather_elements_axis::X; | ||
} | ||
} | ||
|
||
struct gather_elements_impl : typed_primitive_impl_ocl<gather_elements> { | ||
using parent = typed_primitive_impl_ocl<gather_elements>; | ||
using parent::parent; | ||
|
||
std::unique_ptr<primitive_impl> clone() const override { | ||
return make_unique<gather_elements_impl>(*this); | ||
} | ||
|
||
public: | ||
static primitive_impl* create(const gather_elements_node& arg) { | ||
auto gather_elements_params = get_default_params<kernel_selector::gather_elements_params>(arg); | ||
auto gather_elements_optional_params = | ||
get_default_optional_params<kernel_selector::gather_elements_optional_params>(arg.get_program()); | ||
|
||
gather_elements_params.axis = convert_axis(arg.get_primitive()->axis); | ||
|
||
gather_elements_params.inputs.push_back(convert_data_tensor(arg.input(1).get_output_layout())); | ||
|
||
auto& kernel_selector = kernel_selector::gather_elements_kernel_selector::Instance(); | ||
auto best_kernels = kernel_selector.GetBestKernels(gather_elements_params, gather_elements_optional_params); | ||
|
||
CLDNN_ERROR_BOOL(arg.id(), | ||
"Best_kernel.empty()", | ||
best_kernels.empty(), | ||
"Cannot find a proper kernel with this arguments"); | ||
|
||
auto gather_elements = new gather_elements_impl(arg, best_kernels[0]); | ||
|
||
return gather_elements; | ||
} | ||
}; | ||
|
||
namespace detail { | ||
|
||
attach_gather_elements_impl::attach_gather_elements_impl() { | ||
implementation_map<gather_elements>::add(impl_types::ocl, gather_elements_impl::create, { | ||
std::make_tuple(data_types::f32, format::bfyx), | ||
std::make_tuple(data_types::f16, format::bfyx), | ||
std::make_tuple(data_types::i32, format::bfyx), | ||
std::make_tuple(data_types::f32, format::bfzyx), | ||
std::make_tuple(data_types::f16, format::bfzyx), | ||
std::make_tuple(data_types::i32, format::bfzyx), | ||
std::make_tuple(data_types::f32, format::bfwzyx), | ||
std::make_tuple(data_types::f16, format::bfwzyx), | ||
std::make_tuple(data_types::i32, format::bfwzyx), | ||
}); | ||
} | ||
|
||
} // namespace detail | ||
} // namespace ocl | ||
} // namespace cldnn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.