-
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.
Add cpu_impl and gpu_impl selection condition and pass func test
- Loading branch information
1 parent
6f4b86e
commit 0f00606
Showing
8 changed files
with
176 additions
and
50 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "impls/registry/implementation_manager.hpp" | ||
#include "program_node.h" | ||
//#include "intel_gpu/primitives/resample.hpp" | ||
|
||
#include <memory> | ||
namespace cldnn { | ||
namespace ocl { | ||
|
||
struct ResampleImplementationManager : public ImplementationManager { | ||
OV_GPU_PRIMITIVE_IMPL("ocl::resample") | ||
ResampleImplementationManager(shape_types shape_type, ValidateFunc vf = nullptr) : ImplementationManager(impl_types::ocl, shape_type, vf) {} | ||
std::unique_ptr<primitive_impl> create_impl(const program_node& node, const kernel_impl_params& params) const override; | ||
bool validate_impl(const program_node& node) const override { | ||
// auto prim = node.as<resample>().get_primitive(); | ||
// const auto& in0_layout = node.get_input_layout(0); | ||
|
||
// if (in0_layout.data_type == ov::element::f32 && | ||
// prim->operation_type == ov::op::util::InterpolateBase::InterpolateMode::LINEAR_ONNX && | ||
// prim->coord_trans_mode == ov::op::util::InterpolateBase::CoordinateTransformMode::ALIGN_CORNERS && | ||
// prim->shape_calc_mode == ov::op::util::InterpolateBase::ShapeCalcMode::SCALES) { | ||
// return false; | ||
// } | ||
|
||
return true; | ||
} | ||
}; | ||
|
||
} // 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
55 changes: 55 additions & 0 deletions
55
src/plugins/intel_gpu/src/graph/impls/registry/resample_impls.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,55 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "predicates.hpp" | ||
#include "registry.hpp" | ||
#include "intel_gpu/primitives/resample.hpp" | ||
#include "primitive_inst.h" | ||
|
||
#if OV_GPU_WITH_OCL | ||
#include "impls/ocl/resample.hpp" | ||
#endif | ||
|
||
|
||
namespace ov { | ||
namespace intel_gpu { | ||
|
||
using namespace cldnn; | ||
|
||
const std::vector<std::shared_ptr<cldnn::ImplementationManager>>& Registry<resample>::get_implementations() { | ||
static const std::vector<std::shared_ptr<ImplementationManager>> impls = { | ||
OV_GPU_CREATE_INSTANCE_OCL(ocl::ResampleImplementationManager, shape_types::static_shape, | ||
[](const cldnn::program_node& node){ | ||
auto prim = node.as<resample>().get_primitive(); | ||
const auto& in0_layout = node.get_input_layout(0); | ||
|
||
if (in0_layout.data_type == ov::element::f32 && | ||
prim->operation_type == ov::op::util::InterpolateBase::InterpolateMode::LINEAR_ONNX && | ||
prim->coord_trans_mode == ov::op::util::InterpolateBase::CoordinateTransformMode::ALIGN_CORNERS && | ||
prim->shape_calc_mode == ov::op::util::InterpolateBase::ShapeCalcMode::SCALES) { | ||
return false; | ||
} | ||
|
||
return true; | ||
}) | ||
// OV_GPU_CREATE_INSTANCE_OCL(ocl::ResampleImplementationManager, shape_types::dynamic_shape, | ||
// [](const cldnn::program_node& node){ | ||
// return false; | ||
// }) | ||
|
||
OV_GPU_GET_INSTANCE_CPU(resample, shape_types::static_shape, | ||
[](const cldnn::program_node& node){ | ||
return true; | ||
}) | ||
// OV_GPU_GET_INSTANCE_CPU(resample, shape_types::dynamic_shape, | ||
// [](const cldnn::program_node& node){ | ||
// return false; | ||
// }) | ||
}; | ||
|
||
return impls; | ||
} | ||
|
||
} // namespace intel_gpu | ||
} // namespace ov |
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