[IE CLDNN] Base kernels refactoring (#2758)

This commit is contained in:
Vladimir Paramuzov 2020-10-22 14:42:42 +03:00 committed by GitHub
parent e364271cf6
commit 16a73508bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 211 additions and 211 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -56,10 +56,10 @@ struct activation_fuse_params : fuse_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ActivationKernelBase // ActivationKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ActivationKernelBase : public common_kernel_base { class ActivationKernelBase : public KernelBaseOpenCL {
public: public:
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~ActivationKernelBase() {} virtual ~ActivationKernelBase() {}

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -51,9 +51,9 @@ struct arg_max_min_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ArgMaxMinKernelBase // ArgMaxMinKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ArgMaxMinKernelBase : public common_kernel_base { class ArgMaxMinKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~ArgMaxMinKernelBase() {} virtual ~ArgMaxMinKernelBase() {}
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -44,9 +44,9 @@ struct average_unpooling_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AverageUnpoolingKernelBase // AverageUnpoolingKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class AverageUnpoolingKernelBase : public common_kernel_base { class AverageUnpoolingKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~AverageUnpoolingKernelBase() {} virtual ~AverageUnpoolingKernelBase() {}
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <vector> #include <vector>
@ -46,9 +46,9 @@ struct batch_to_space_fuse_params : fuse_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BatchToSpaceKernelBase // BatchToSpaceKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class BatchToSpaceKernelBase : public common_kernel_base { class BatchToSpaceKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~BatchToSpaceKernelBase() {} virtual ~BatchToSpaceKernelBase() {}
struct DispatchData : public CommonDispatchData {}; struct DispatchData : public CommonDispatchData {};

View File

@ -1,4 +1,4 @@
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -46,9 +46,9 @@ struct border_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BorderKernelBase // BorderKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class BorderKernelBase : public common_kernel_base { class BorderKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2018-2019 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <vector> #include <vector>
@ -37,9 +37,9 @@ struct broadcast_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BroadcastKernelBase // BroadcastKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class BroadcastKernelBase : public common_kernel_base { class BroadcastKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -58,9 +58,9 @@ struct concatenation_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ConcatenationKernelBase // ConcatenationKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ConcatenationKernelBase : public common_kernel_base { class ConcatenationKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~ConcatenationKernelBase() {} virtual ~ConcatenationKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -20,9 +20,9 @@
namespace kernel_selector { namespace kernel_selector {
class DeformableConvolutionKernel_bfyx_interp : public common_kernel_base { class DeformableConvolutionKernel_bfyx_interp : public KernelBaseOpenCL {
public: public:
DeformableConvolutionKernel_bfyx_interp() : common_kernel_base("deformable_convolution_gpu_bfyx_interp") {} DeformableConvolutionKernel_bfyx_interp() : KernelBaseOpenCL("deformable_convolution_gpu_bfyx_interp") {}
virtual ~DeformableConvolutionKernel_bfyx_interp() {} virtual ~DeformableConvolutionKernel_bfyx_interp() {}
KernelsData GetKernelsData(const Params& params, const optional_params& options) const override; KernelsData GetKernelsData(const Params& params, const optional_params& options) const override;

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <string> #include <string>
@ -37,9 +37,9 @@ struct ctc_greedy_decoder_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CTCGreedyDecoderKernelBase // CTCGreedyDecoderKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class CTCGreedyDecoderKernelBase : public common_kernel_base { class CTCGreedyDecoderKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~CTCGreedyDecoderKernelBase() {} virtual ~CTCGreedyDecoderKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
@ -40,9 +40,9 @@ struct cum_sum_optional_params : optional_params {
cum_sum_optional_params() : optional_params(KernelType::CUM_SUM) {} cum_sum_optional_params() : optional_params(KernelType::CUM_SUM) {}
}; };
class CumSumKernelBase : public common_kernel_base { class CumSumKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~CumSumKernelBase() = default; virtual ~CumSumKernelBase() = default;
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -48,9 +48,9 @@ struct depth_to_space_fuse_params : fuse_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DepthToSpaceKernelBase // DepthToSpaceKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class DepthToSpaceKernelBase : public common_kernel_base { class DepthToSpaceKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~DepthToSpaceKernelBase() {} virtual ~DepthToSpaceKernelBase() {}
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -64,9 +64,9 @@ struct detection_output_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DetectionOutputKernelBase // DetectionOutputKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class DetectionOutputKernelBase : public common_kernel_base { class DetectionOutputKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base ::common_kernel_base; using KernelBaseOpenCL ::KernelBaseOpenCL;
virtual ~DetectionOutputKernelBase() {} virtual ~DetectionOutputKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include <vector> #include <vector>
namespace kernel_selector { namespace kernel_selector {
@ -112,9 +112,9 @@ struct scale_fuse_params : fuse_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EltwiseKernelBase // EltwiseKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class EltwiseKernelBase : public common_kernel_base { class EltwiseKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~EltwiseKernelBase() {} virtual ~EltwiseKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -42,9 +42,9 @@ struct embedding_bag_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EmbeddingBagKernelRef // EmbeddingBagKernelRef
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class EmbeddingBagKernelRef : public common_kernel_base { class EmbeddingBagKernelRef : public KernelBaseOpenCL {
public: public:
EmbeddingBagKernelRef() : common_kernel_base("embedding_bag_ref") {} EmbeddingBagKernelRef() : KernelBaseOpenCL("embedding_bag_ref") {}
virtual ~EmbeddingBagKernelRef() = default; virtual ~EmbeddingBagKernelRef() = default;
protected: protected:

View File

@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <vector> #include <vector>
@ -41,9 +41,9 @@ struct extract_image_patches_optional_params : optional_params {
extract_image_patches_optional_params() : optional_params(KernelType::EXTRACT_IMAGE_PATCHES) {} extract_image_patches_optional_params() : optional_params(KernelType::EXTRACT_IMAGE_PATCHES) {}
}; };
class ExtractImagePatchesKernelBase : public common_kernel_base { class ExtractImagePatchesKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;
virtual ~ExtractImagePatchesKernelBase() {} virtual ~ExtractImagePatchesKernelBase() {}

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -37,9 +37,9 @@ struct gather_optional_params : optional_params {
gather_optional_params() : optional_params(KernelType::GATHER) {} gather_optional_params() : optional_params(KernelType::GATHER) {}
}; };
class GatherKernelRef : public common_kernel_base { class GatherKernelRef : public KernelBaseOpenCL {
public: public:
GatherKernelRef() : common_kernel_base("gather_ref") {} GatherKernelRef() : KernelBaseOpenCL("gather_ref") {}
virtual ~GatherKernelRef() {} virtual ~GatherKernelRef() {}
virtual JitConstants GetJitConstants(const gather_params& params) const; virtual JitConstants GetJitConstants(const gather_params& params) const;
virtual CommonDispatchData SetDefault(const gather_params& params, const optional_params&) const; virtual CommonDispatchData SetDefault(const gather_params& params, const optional_params&) const;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -34,9 +34,9 @@ struct gather_tree_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BorderKernelBase // BorderKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class GatherTreeKernelBase : public common_kernel_base { class GatherTreeKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;
protected: protected:

View File

@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -48,9 +48,9 @@ struct gemm_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BorderKernelBase // BorderKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class GemmKernelBase : public common_kernel_base { class GemmKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
using FusedOpDesc = fused_operation_desc; using FusedOpDesc = fused_operation_desc;
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;
virtual ~GemmKernelBase() {} virtual ~GemmKernelBase() {}

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <string> #include <string>
@ -37,9 +37,9 @@ struct grn_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GRNKernelBase // GRNKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class GRNKernelBase : public common_kernel_base { class GRNKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~GRNKernelBase() {} virtual ~GRNKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -18,7 +18,7 @@
namespace kernel_selector { namespace kernel_selector {
bool LRNKernelBase::Validate(const Params& p, const optional_params& o) const { bool LRNKernelBase::Validate(const Params& p, const optional_params& o) const {
if (!common_kernel_base::Validate(p, o) || p.GetType() != KernelType::LRN || o.GetType() != KernelType::LRN) { if (!KernelBaseOpenCL::Validate(p, o) || p.GetType() != KernelType::LRN || o.GetType() != KernelType::LRN) {
return false; return false;
} }

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -52,9 +52,9 @@ struct lrn_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// lrn_kernel_base // lrn_kernel_base
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class LRNKernelBase : public common_kernel_base { class LRNKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~LRNKernelBase() {} virtual ~LRNKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <vector> #include <vector>
#include <map> #include <map>
@ -82,9 +82,9 @@ struct lstm_elt_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LSTMEltKernelBase // LSTMEltKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class LSTMEltKernelBase : public common_kernel_base { class LSTMEltKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~LSTMEltKernelBase() {} virtual ~LSTMEltKernelBase() {}
struct DispatchData : public CommonDispatchData {}; struct DispatchData : public CommonDispatchData {};

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -71,9 +71,9 @@ struct lstm_gemm_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LSTMGemmKernelBase // LSTMGemmKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class LSTMGemmKernelBase : public common_kernel_base { class LSTMGemmKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~LSTMGemmKernelBase() {} virtual ~LSTMGemmKernelBase() {}
struct DispatchData : public CommonDispatchData {}; struct DispatchData : public CommonDispatchData {};

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "weight_bias_params.h" #include "weight_bias_params.h"
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -39,9 +39,9 @@ struct lstm_dynamic_input_optional_params : weight_bias_optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LSTM_DynamicInputKernelBase // LSTM_DynamicInputKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class LSTM_DynamicInputKernelBase : public common_kernel_base { class LSTM_DynamicInputKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~LSTM_DynamicInputKernelBase() {} virtual ~LSTM_DynamicInputKernelBase() {}
struct DispatchData : public CommonDispatchData {}; struct DispatchData : public CommonDispatchData {};

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -93,9 +93,9 @@ struct lstm_dynamic_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LSTM_DynamicTimeloopKernelBase // LSTM_DynamicTimeloopKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class LSTM_DynamicTimeloopKernelBase : public common_kernel_base { class LSTM_DynamicTimeloopKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~LSTM_DynamicTimeloopKernelBase() {} virtual ~LSTM_DynamicTimeloopKernelBase() {}
struct DispatchData : public CommonDispatchData {}; struct DispatchData : public CommonDispatchData {};

View File

@ -1,4 +1,4 @@
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -38,9 +38,9 @@ struct max_unpooling_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MaxUnpoolingKernelBase // MaxUnpoolingKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class MaxUnpoolingKernelBase : public common_kernel_base { class MaxUnpoolingKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~MaxUnpoolingKernelBase() {} virtual ~MaxUnpoolingKernelBase() {}
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <string> #include <string>
@ -52,9 +52,9 @@ struct mvn_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MVNKernelBase // MVNKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class MVNKernelBase : public common_kernel_base { class MVNKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~MVNKernelBase() {} virtual ~MVNKernelBase() {}
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -47,9 +47,9 @@ struct normalize_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NormalizeKernelBase // NormalizeKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class NormalizeKernelBase : public common_kernel_base { class NormalizeKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~NormalizeKernelBase() {} virtual ~NormalizeKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -40,9 +40,9 @@ struct one_hot_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// OneHotKernelBase // OneHotKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class OneHotKernelBase : public common_kernel_base { class OneHotKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016-2019 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include <vector> #include <vector>
namespace kernel_selector { namespace kernel_selector {
@ -40,9 +40,9 @@ struct permute_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PermuteKernelRef // PermuteKernelRef
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class PermuteKernelRef : public common_kernel_base { class PermuteKernelRef : public KernelBaseOpenCL {
public: public:
PermuteKernelRef() : common_kernel_base("permute_ref") {} PermuteKernelRef() : KernelBaseOpenCL("permute_ref") {}
virtual ~PermuteKernelRef() {} virtual ~PermuteKernelRef() {}
JitConstants GetJitConstants(const permute_params& params) const; JitConstants GetJitConstants(const permute_params& params) const;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -54,9 +54,9 @@ struct pooling_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PoolingKernelBase // PoolingKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class PoolingKernelBase : public common_kernel_base { class PoolingKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~PoolingKernelBase() {} virtual ~PoolingKernelBase() {}
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2018-2019 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -43,9 +43,9 @@ struct PyramidROIAlign_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PyramidROIAlignKernelBase // PyramidROIAlignKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class PyramidROIAlignKernelBase : public common_kernel_base { class PyramidROIAlignKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~PyramidROIAlignKernelBase() {} virtual ~PyramidROIAlignKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,14 +15,14 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "quantize_kernel_params.h" #include "quantize_kernel_params.h"
namespace kernel_selector { namespace kernel_selector {
class QuantizeKernelBase : public common_kernel_base { class QuantizeKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~QuantizeKernelBase() {} virtual ~QuantizeKernelBase() {}
bool Validate(const Params& p, const optional_params& o) const override; bool Validate(const Params& p, const optional_params& o) const override;

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -41,9 +41,9 @@ struct reduce_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ReduceKernelBase // ReduceKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ReduceKernelBase : public common_kernel_base { class ReduceKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;
virtual ~ReduceKernelBase() {} virtual ~ReduceKernelBase() {}

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -49,9 +49,9 @@ struct region_yolo_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// RegionYoloKernelRef // RegionYoloKernelRef
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class RegionYoloKernelRef : public common_kernel_base { class RegionYoloKernelRef : public KernelBaseOpenCL {
public: public:
RegionYoloKernelRef() : common_kernel_base("region_yolo_gpu_ref") {} RegionYoloKernelRef() : KernelBaseOpenCL("region_yolo_gpu_ref") {}
virtual ~RegionYoloKernelRef() {} virtual ~RegionYoloKernelRef() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <vector> #include <vector>
@ -94,9 +94,9 @@ struct reorder_weights_params : public Params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ReorderKernelBase // ReorderKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ReorderKernelBase : public common_kernel_base { class ReorderKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~ReorderKernelBase() {} virtual ~ReorderKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -44,9 +44,9 @@ struct reorg_yolo_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ReorgYoloKernelRef // ReorgYoloKernelRef
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ReorgYoloKernelRef : public common_kernel_base { class ReorgYoloKernelRef : public KernelBaseOpenCL {
public: public:
ReorgYoloKernelRef() : common_kernel_base("reorg_yolo_gpu_ref") {} ReorgYoloKernelRef() : KernelBaseOpenCL("reorg_yolo_gpu_ref") {}
virtual ~ReorgYoloKernelRef() {} virtual ~ReorgYoloKernelRef() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016-2019 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include <map> #include <map>
@ -54,10 +54,10 @@ struct resample_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ResampleKernelBase // ResampleKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ResampleKernelBase : public common_kernel_base { class ResampleKernelBase : public KernelBaseOpenCL {
public: public:
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~ResampleKernelBase() {} virtual ~ResampleKernelBase() {}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016-2019 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -73,7 +73,7 @@ KernelsData ReshapeKernelRef::GetKernelsData(const Params& params, const optiona
} }
bool ReshapeKernelRef::Validate(const Params& p, const optional_params& op) const { bool ReshapeKernelRef::Validate(const Params& p, const optional_params& op) const {
if (!common_kernel_base::Validate(p, op)) if (!KernelBaseOpenCL::Validate(p, op))
return false; return false;
const auto& rp = static_cast<const reshape_params&>(p); const auto& rp = static_cast<const reshape_params&>(p);

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016-2019 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -33,9 +33,9 @@ struct reshape_optional_params : optional_params {
reshape_optional_params() : optional_params(KernelType::RESHAPE) {} reshape_optional_params() : optional_params(KernelType::RESHAPE) {}
}; };
class ReshapeKernelRef : public common_kernel_base { class ReshapeKernelRef : public KernelBaseOpenCL {
public: public:
ReshapeKernelRef() : common_kernel_base("reshape_ref") {} ReshapeKernelRef() : KernelBaseOpenCL("reshape_ref") {}
virtual ~ReshapeKernelRef() {} virtual ~ReshapeKernelRef() {}
KernelsData GetKernelsData(const Params& params, const optional_params& options) const override; KernelsData GetKernelsData(const Params& params, const optional_params& options) const override;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -37,9 +37,9 @@ struct reverse_sequence_optional_params : optional_params {
reverse_sequence_optional_params() : optional_params(KernelType::REVERSE_SEQUENCE) {} reverse_sequence_optional_params() : optional_params(KernelType::REVERSE_SEQUENCE) {}
}; };
class ReverseSequenceKernelRef : public common_kernel_base { class ReverseSequenceKernelRef : public KernelBaseOpenCL {
public: public:
ReverseSequenceKernelRef() : common_kernel_base("reverse_sequence_ref") {} ReverseSequenceKernelRef() : KernelBaseOpenCL("reverse_sequence_ref") {}
virtual ~ReverseSequenceKernelRef() {} virtual ~ReverseSequenceKernelRef() {}
virtual JitConstants GetJitConstants(const reverse_sequence_params& params) const; virtual JitConstants GetJitConstants(const reverse_sequence_params& params) const;
virtual CommonDispatchData SetDefault(const reverse_sequence_params& params, const optional_params&) const; virtual CommonDispatchData SetDefault(const reverse_sequence_params& params, const optional_params&) const;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -15,7 +15,7 @@
#pragma once #pragma once
#include <iostream> #include <iostream>
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -57,9 +57,9 @@ struct roi_pooling_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ROIPoolingKernelBase // ROIPoolingKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class ROIPoolingKernelBase : public common_kernel_base { class ROIPoolingKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~ROIPoolingKernelBase() {} virtual ~ROIPoolingKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -37,9 +37,9 @@ struct scatter_update_optional_params : optional_params {
scatter_update_optional_params() : optional_params(KernelType::SCATTER_UPDATE) {} scatter_update_optional_params() : optional_params(KernelType::SCATTER_UPDATE) {}
}; };
class ScatterUpdateKernelRef : public common_kernel_base { class ScatterUpdateKernelRef : public KernelBaseOpenCL {
public: public:
ScatterUpdateKernelRef() : common_kernel_base("scatter_update_ref") {} ScatterUpdateKernelRef() : KernelBaseOpenCL("scatter_update_ref") {}
virtual ~ScatterUpdateKernelRef() {} virtual ~ScatterUpdateKernelRef() {}
virtual JitConstants GetJitConstants(const scatter_update_params& params) const; virtual JitConstants GetJitConstants(const scatter_update_params& params) const;
virtual CommonDispatchData SetDefault(const scatter_update_params& params, const optional_params&, bool is_second) const; virtual CommonDispatchData SetDefault(const scatter_update_params& params, const optional_params&, bool is_second) const;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -36,9 +36,9 @@ struct select_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SelectKernelBase // SelectKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class SelectKernelBase : public common_kernel_base { class SelectKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~SelectKernelBase() {} virtual ~SelectKernelBase() {}
using DispatchData = CommonDispatchData; using DispatchData = CommonDispatchData;

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2019 Intel Corporation // Copyright (c) 2019-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -38,9 +38,9 @@ struct shuffle_channels_optional_params : optional_params {
shuffle_channels_optional_params() : optional_params(KernelType::SHUFFLE_CHANNELS) {} shuffle_channels_optional_params() : optional_params(KernelType::SHUFFLE_CHANNELS) {}
}; };
class ShuffleChannelsKernelRef : public common_kernel_base { class ShuffleChannelsKernelRef : public KernelBaseOpenCL {
public: public:
ShuffleChannelsKernelRef() : common_kernel_base("shuffle_channels_ref") {} ShuffleChannelsKernelRef() : KernelBaseOpenCL("shuffle_channels_ref") {}
virtual ~ShuffleChannelsKernelRef() {} virtual ~ShuffleChannelsKernelRef() {}
KernelsData GetKernelsData(const Params& params, const optional_params& options) const override; KernelsData GetKernelsData(const Params& params, const optional_params& options) const override;
ParamsKey GetSupportedKey() const override; ParamsKey GetSupportedKey() const override;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
namespace kernel_selector { namespace kernel_selector {
@ -43,9 +43,9 @@ struct softmax_optional_params : optional_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SoftmaxKernelBase // SoftmaxKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class SoftmaxKernelBase : public common_kernel_base { class SoftmaxKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~SoftmaxKernelBase() {} virtual ~SoftmaxKernelBase() {}
struct DispatchData : public CommonDispatchData { struct DispatchData : public CommonDispatchData {

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "kernel_selector_params.h" #include "kernel_selector_params.h"
#include <vector> #include <vector>
@ -47,9 +47,9 @@ struct space_to_batch_fuse_params : fuse_params {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SpaceToBatchKernelBase // SpaceToBatchKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class SpaceToBatchKernelBase : public common_kernel_base { class SpaceToBatchKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~SpaceToBatchKernelBase() {} virtual ~SpaceToBatchKernelBase() {}
struct DispatchData : public CommonDispatchData {}; struct DispatchData : public CommonDispatchData {};

View File

@ -16,7 +16,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
@ -40,9 +40,9 @@ struct space_to_depth_optional_params : optional_params {
space_to_depth_optional_params() : optional_params(KernelType::SPACE_TO_DEPTH) {} space_to_depth_optional_params() : optional_params(KernelType::SPACE_TO_DEPTH) {}
}; };
class SpaceToDepthKernelRef : public common_kernel_base { class SpaceToDepthKernelRef : public KernelBaseOpenCL {
public: public:
SpaceToDepthKernelRef() : common_kernel_base("space_to_depth_ref") {} SpaceToDepthKernelRef() : KernelBaseOpenCL("space_to_depth_ref") {}
virtual ~SpaceToDepthKernelRef() = default; virtual ~SpaceToDepthKernelRef() = default;
KernelsData GetKernelsData(const Params& params, const optional_params& options) const override; KernelsData GetKernelsData(const Params& params, const optional_params& options) const override;
ParamsKey GetSupportedKey() const override; ParamsKey GetSupportedKey() const override;

View File

@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include <vector> #include <vector>
namespace kernel_selector { namespace kernel_selector {
@ -41,9 +41,9 @@ struct strided_slice_optional_params : optional_params {
strided_slice_optional_params() : optional_params(KernelType::STRIDED_SLICE) {} strided_slice_optional_params() : optional_params(KernelType::STRIDED_SLICE) {}
}; };
class StridedSliceKernelRef : public common_kernel_base { class StridedSliceKernelRef : public KernelBaseOpenCL {
public: public:
StridedSliceKernelRef() : common_kernel_base("strided_slice_ref") {} StridedSliceKernelRef() : KernelBaseOpenCL("strided_slice_ref") {}
virtual ~StridedSliceKernelRef() {} virtual ~StridedSliceKernelRef() {}
virtual JitConstants GetJitConstants(const strided_slice_params& params) const; virtual JitConstants GetJitConstants(const strided_slice_params& params) const;
virtual CommonDispatchData SetDefault(const strided_slice_params& params, const optional_params&) const; virtual CommonDispatchData SetDefault(const strided_slice_params& params, const optional_params&) const;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2018 Intel Corporation // Copyright (c) 2018-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -36,9 +36,9 @@ struct tile_optional_params : optional_params {
tile_optional_params() : optional_params(KernelType::TILE) {} tile_optional_params() : optional_params(KernelType::TILE) {}
}; };
class TileKernelRef : public common_kernel_base { class TileKernelRef : public KernelBaseOpenCL {
public: public:
TileKernelRef() : common_kernel_base("tile_ref") {} TileKernelRef() : KernelBaseOpenCL("tile_ref") {}
virtual ~TileKernelRef() {} virtual ~TileKernelRef() {}
virtual JitConstants GetJitConstants(const tile_params& params) const; virtual JitConstants GetJitConstants(const tile_params& params) const;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2016-2019 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -72,7 +72,7 @@ public:
}; };
} // namespace } // namespace
std::string common_kernel_base::GetEntryPoint(const std::string& templateName, std::string KernelBaseOpenCL::GetEntryPoint(const std::string& templateName,
const std::string& layerID, const std::string& layerID,
const optional_params& options) const { const optional_params& options) const {
std::string kernelID = layerID; std::string kernelID = layerID;
@ -89,7 +89,7 @@ std::string common_kernel_base::GetEntryPoint(const std::string& templateName,
return kernelID; return kernelID;
} }
std::string common_kernel_base::CreateJit(const std::string& template_name, std::string KernelBaseOpenCL::CreateJit(const std::string& template_name,
const JitConstants& constants, const JitConstants& constants,
const std::string& kernel_id) const { const std::string& kernel_id) const {
class CodeBuilder code; class CodeBuilder code;
@ -109,7 +109,7 @@ std::string common_kernel_base::CreateJit(const std::string& template_name,
return jit; return jit;
} }
Arguments common_kernel_base::GetArgsDesc(uint32_t num_of_input, Arguments KernelBaseOpenCL::GetArgsDesc(uint32_t num_of_input,
bool use_weights, bool use_weights,
bool use_bias, bool use_bias,
uint32_t number_of_inputs_for_fused_prim) const { uint32_t number_of_inputs_for_fused_prim) const {
@ -136,7 +136,7 @@ Arguments common_kernel_base::GetArgsDesc(uint32_t num_of_input,
return args; return args;
} }
std::shared_ptr<KernelString> common_kernel_base::GetKernelString(const std::string& name, std::shared_ptr<KernelString> KernelBaseOpenCL::GetKernelString(const std::string& name,
const std::string& jit, const std::string& jit,
const std::string& entry_point, const std::string& entry_point,
const EngineInfo& engine_info, const EngineInfo& engine_info,
@ -160,7 +160,7 @@ std::shared_ptr<KernelString> common_kernel_base::GetKernelString(const std::str
return kernel_string; return kernel_string;
} }
uint32_t common_kernel_base::GetFusedPrimitiveInputsCount(const Params &params) const { uint32_t KernelBaseOpenCL::GetFusedPrimitiveInputsCount(const Params &params) const {
auto p = dynamic_cast<const base_params&>(params); auto p = dynamic_cast<const base_params&>(params);
uint32_t fused_deps_total = 0; uint32_t fused_deps_total = 0;
for (auto fused_op : p.fused_ops) { for (auto fused_op : p.fused_ops) {
@ -170,7 +170,7 @@ uint32_t common_kernel_base::GetFusedPrimitiveInputsCount(const Params &params)
return fused_deps_total; return fused_deps_total;
} }
void common_kernel_base::FillCLKernelData(clKernelData& kernel, void KernelBaseOpenCL::FillCLKernelData(clKernelData& kernel,
const CommonDispatchData& dispatchData, const CommonDispatchData& dispatchData,
const EngineInfo& engine_info, const EngineInfo& engine_info,
const std::string& kernelMapName, const std::string& kernelMapName,
@ -181,7 +181,7 @@ void common_kernel_base::FillCLKernelData(clKernelData& kernel,
bool bias, bool bias,
int number_of_inputs, int number_of_inputs,
uint32_t number_of_inputs_for_fused_prims) const { uint32_t number_of_inputs_for_fused_prims) const {
CheckDispatchData(kernelMapName, dispatchData); KernelBase::CheckDispatchData(kernelMapName, dispatchData);
kernel.workGroups.global = dispatchData.gws; kernel.workGroups.global = dispatchData.gws;
kernel.workGroups.local = dispatchData.lws; kernel.workGroups.local = dispatchData.lws;
kernel.kernelString = GetKernelString(kernelMapName, jit, entryPoint, engine_info, exeMode); kernel.kernelString = GetKernelString(kernelMapName, jit, entryPoint, engine_info, exeMode);

View File

@ -22,10 +22,10 @@
namespace kernel_selector { namespace kernel_selector {
class common_kernel_base : public KernelBase { class KernelBaseOpenCL : public KernelBase {
public: public:
using KernelBase::KernelBase; using KernelBase::KernelBase;
virtual ~common_kernel_base() {} virtual ~KernelBaseOpenCL() {}
protected: protected:
virtual bool Validate(const Params&, const optional_params&) const { return true; } virtual bool Validate(const Params&, const optional_params&) const { return true; }

View File

@ -1,5 +1,5 @@
/* /*
// Copyright (c) 2016 Intel Corporation // Copyright (c) 2016-2020 Intel Corporation
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -16,16 +16,16 @@
#pragma once #pragma once
#include "common_kernel_base.h" #include "kernel_base_opencl.h"
#include "weight_bias_params.h" #include "weight_bias_params.h"
namespace kernel_selector { namespace kernel_selector {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// WeightsBiasKernelBase // WeightsBiasKernelBase
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class WeightBiasKernelBase : public common_kernel_base { class WeightBiasKernelBase : public KernelBaseOpenCL {
public: public:
using common_kernel_base::common_kernel_base; using KernelBaseOpenCL::KernelBaseOpenCL;
virtual ~WeightBiasKernelBase() {} virtual ~WeightBiasKernelBase() {}
protected: protected: