• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020-2022 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MINDSPORE_CCSRC_RUNTIME_DEVICE_CPU_KERNEL_SELECT_CPU_H_
18 #define MINDSPORE_CCSRC_RUNTIME_DEVICE_CPU_KERNEL_SELECT_CPU_H_
19 
20 #include <utility>
21 #include <string>
22 #include <vector>
23 
24 #include "ir/anf.h"
25 #include "ir/dtype/type.h"
26 #include "include/common/utils/utils.h"
27 #include "utils/ms_context.h"
28 #include "kernel/common_utils.h"
29 #include "kernel/framework_utils.h"
30 #include "kernel/kernel_build_info.h"
31 #include "kernel/graph_kernel_info.h"
32 #include "include/backend/visible.h"
33 
34 namespace mindspore {
35 namespace device {
36 namespace cpu {
37 using kernel::DataType;
38 bool IsVmapNotSupported(const CNodePtr &node);
39 BACKEND_EXPORT std::pair<std::string, ExceptionType> SetKernelInfoWithMsg(const CNodePtr &apply_kernel_ptr);
40 
41 class BACKEND_EXPORT CPUGraphKernelInfo : public GraphKernelInfo {
42  public:
43   CPUGraphKernelInfo() = default;
44   virtual ~CPUGraphKernelInfo() = default;
45   void SetKernelInfo(const CNodePtr &kernel_node, KernelType kernel_type) override;
46 };
47 
48 REG_GRAPH_KERNEL_INFO(kCPUDevice, CPUGraphKernelInfo);
49 }  // namespace cpu
50 }  // namespace device
51 }  // namespace mindspore
52 
53 #endif  // MINDSPORE_CCSRC_RUNTIME_DEVICE_CPU_KERNEL_SELECT_CPU_H_
54