// 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: <eigen@codeplay.com> // // 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/.
// Make sure this is only available when targeting a GPU: we don't want to // introduce conflicts between these packet_traits definitions and the ones // we'll use on the host side (SSE, AVX, ...) #define SYCL_ARITHMETIC(packet_type) \ template <> \ struct is_arithmetic<packet_type> { \ enum { value = true }; \
};
SYCL_ARITHMETIC(cl::sycl::cl_float4)
SYCL_ARITHMETIC(cl::sycl::cl_double2) #undef SYCL_ARITHMETIC
template <typename PacketReturnType, int PacketSize> struct PacketWrapper; // This function should never get called on the device #ifndef SYCL_DEVICE_ONLY template <typename PacketReturnType, int PacketSize> struct PacketWrapper { typedeftypename ::Eigen::internal::unpacket_traits<PacketReturnType>::type
Scalar; template <typename Index>
EIGEN_DEVICE_FUNC static Scalar scalarize(Index, PacketReturnType &) {
eigen_assert(false && "THERE IS NO PACKETIZE VERSION FOR THE CHOSEN TYPE");
abort();
}
EIGEN_DEVICE_FUNC static PacketReturnType convert_to_packet_type(Scalar in,
Scalar) { return ::Eigen::internal::template plset<PacketReturnType>(in);
}
EIGEN_DEVICE_FUNC staticvoid set_packet(PacketReturnType, Scalar *) {
eigen_assert(false && "THERE IS NO PACKETIZE VERSION FOR THE CHOSEN TYPE");
abort();
}
};
#elifdefined(SYCL_DEVICE_ONLY) template <typename PacketReturnType> struct PacketWrapper<PacketReturnType, 4> { typedeftypename ::Eigen::internal::unpacket_traits<PacketReturnType>::type
Scalar; template <typename Index>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE static Scalar scalarize(Index index, PacketReturnType &in) { switch (index) { case 0: return in.x(); case 1: return in.y(); case 2: return in.z(); case 3: return in.w(); default: //INDEX MUST BE BETWEEN 0 and 3.There is no abort function in SYCL kernel. so we cannot use abort here. // The code will never reach here
__builtin_unreachable();
}
__builtin_unreachable();
}
template <typename PacketReturnType> struct PacketWrapper<PacketReturnType, 2> { typedeftypename ::Eigen::internal::unpacket_traits<PacketReturnType>::type
Scalar; template <typename Index>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE static Scalar scalarize(Index index, PacketReturnType &in) { switch (index) { case 0: return in.x(); case 1: return in.y(); default: //INDEX MUST BE BETWEEN 0 and 1.There is no abort function in SYCL kernel. so we cannot use abort here. // The code will never reach here
__builtin_unreachable();
}
__builtin_unreachable();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.