// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Mehdi Goli Codeplay Software Ltd. // Ralph Potter Codeplay Software Ltd. // Luke Iwanski Codeplay Software Ltd. // Contact: // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. /***************************************************************** * TensorSyclConvertToDeviceExpression.h * * \brief: * Conversion from host pointer to device pointer * inside leaf nodes of the expression. * *****************************************************************/ #ifndef UNSUPPORTED_EIGEN_CXX11_SRC_TENSORYSYCL_TENSORSYCL_CONVERT_TO_DEVICE_EXPRESSION_HPP #define UNSUPPORTED_EIGEN_CXX11_SRC_TENSORYSYCL_TENSORSYCL_CONVERT_TO_DEVICE_EXPRESSION_HPP namespace Eigen { namespace TensorSycl { namespace internal { /// \struct ConvertToDeviceExpression /// \brief This struct is used to convert the MakePointer in the host expression /// to the MakeGlobalPointer for the device expression. For the leafNodes /// containing the pointer. This is due to the fact that the address space of /// the pointer T* is different on the host and the device. template struct ConvertToDeviceExpression; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorMap template class MakePointer_> struct ConvertToDeviceExpression< TensorMap, Options2_, MakePointer_>> { using Type = TensorMap, Options2_, MakeGlobalPointer>; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorMap template class MakePointer_> struct ConvertToDeviceExpression< const TensorMap, Options2_, MakePointer_>> { using Type = const TensorMap, Options2_, MakeGlobalPointer>; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorCwiseNullaryOp template struct ConvertToDeviceExpression> { using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorCwiseNullaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorCwiseNullaryOp template struct ConvertToDeviceExpression> { using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorCwiseNullaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorBroadcastingOp template struct ConvertToDeviceExpression> { using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorBroadcastingOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorBroadcastingOp template struct ConvertToDeviceExpression> { using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorBroadcastingOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorCwiseUnaryOp template struct ConvertToDeviceExpression> { using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorCwiseUnaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorCwiseUnaryOp template struct ConvertToDeviceExpression> { using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorCwiseUnaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorCwiseBinaryOp template struct ConvertToDeviceExpression< const TensorCwiseBinaryOp> { using LHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorCwiseBinaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorCwiseBinaryOp template struct ConvertToDeviceExpression> { using LHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorCwiseBinaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorCwiseTernaryOp template struct ConvertToDeviceExpression< const TensorCwiseTernaryOp> { using Arg1PlaceHolderType = typename ConvertToDeviceExpression::Type; using Arg2PlaceHolderType = typename ConvertToDeviceExpression::Type; using Arg3PlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorCwiseTernaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorCwiseTernaryOp template struct ConvertToDeviceExpression< TensorCwiseTernaryOp> { using Arg1PlaceHolderType = typename ConvertToDeviceExpression::Type; using Arg2PlaceHolderType = typename ConvertToDeviceExpression::Type; using Arg3PlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorCwiseTernaryOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorCwiseSelectOp template struct ConvertToDeviceExpression< const TensorSelectOp> { using IfPlaceHolderType = typename ConvertToDeviceExpression::Type; using ThenPlaceHolderType = typename ConvertToDeviceExpression::Type; using ElsePlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorSelectOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorCwiseSelectOp template struct ConvertToDeviceExpression> { using IfPlaceHolderType = typename ConvertToDeviceExpression::Type; using ThenPlaceHolderType = typename ConvertToDeviceExpression::Type; using ElsePlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorSelectOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const AssingOP template struct ConvertToDeviceExpression> { using LHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorAssignOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is AssingOP template struct ConvertToDeviceExpression> { using LHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using RHSPlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorAssignOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorForcedEvalOp template struct ConvertToDeviceExpression> { using PlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorForcedEvalOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorForcedEvalOp template struct ConvertToDeviceExpression> { using PlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorForcedEvalOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is const TensorEvalToOp template struct ConvertToDeviceExpression> { using PlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = const TensorEvalToOp; }; /// specialisation of the \ref ConvertToDeviceExpression struct when the node /// type is TensorEvalToOp template struct ConvertToDeviceExpression> { using PlaceHolderType = typename ConvertToDeviceExpression::Type; using Type = TensorEvalToOp; }; } // namespace internal } // namespace TensorSycl } // namespace Eigen #endif // UNSUPPORTED_EIGEN_CXX1