/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once #include "paddle/math/Matrix.h" namespace paddle { enum DeviceType { DEVICE_TYPE_UNSPECIFIED = 0, DEVICE_TYPE_CPU = 1, DEVICE_TYPE_GPU = 2, }; template struct MatrixT; template <> struct MatrixT { using type = CpuMatrix; }; template <> struct MatrixT { using type = GpuMatrix; }; template struct CrossMapNormal { void operator()(typename MatrixT::type& outputs, typename MatrixT::type& denoms, typename MatrixT::type& inputs, size_t channels, size_t imgSizeH, size_t imgSizeW, size_t sizeX, real scale, real pow); }; template struct CrossMapNormalGrad { void operator()(typename MatrixT::type& inputsGrad, typename MatrixT::type& inputsValue, typename MatrixT::type& outputsGrad, typename MatrixT::type& outputsValue, typename MatrixT::type& denoms, size_t channels, size_t imgSizeH, size_t imgSizeW, size_t sizeX, real scale, real pow); }; } // namespace paddle