21 #ifndef EIGEN_TYPE_CASTING_SYCL_H 22 #define EIGEN_TYPE_CASTING_SYCL_H 25 #include "../../InternalHeaderCheck.h" 30 #ifdef SYCL_DEVICE_ONLY 32 struct type_casting_traits<float, int> {
33 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
37 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_int4 pcast<cl::sycl::cl_float4, cl::sycl::cl_int4>(
38 const cl::sycl::cl_float4& a) {
39 return a.template convert<cl::sycl::cl_int, cl::sycl::rounding_mode::automatic>();
43 struct type_casting_traits<int, float> {
44 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
48 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_float4 pcast<cl::sycl::cl_int4, cl::sycl::cl_float4>(
49 const cl::sycl::cl_int4& a) {
50 return a.template convert<cl::sycl::cl_float, cl::sycl::rounding_mode::automatic>();
54 struct type_casting_traits<double, float> {
55 enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
59 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_float4 pcast<cl::sycl::cl_double2, cl::sycl::cl_float4>(
60 const cl::sycl::cl_double2& a,
const cl::sycl::cl_double2& b) {
61 auto a1 = a.template convert<cl::sycl::cl_float, cl::sycl::rounding_mode::automatic>();
62 auto b1 = b.template convert<cl::sycl::cl_float, cl::sycl::rounding_mode::automatic>();
63 return cl::sycl::cl_float4(a1.x(), a1.y(), b1.x(), b1.y());
67 struct type_casting_traits<float, double> {
68 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
72 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_double2 pcast<cl::sycl::cl_float4, cl::sycl::cl_double2>(
73 const cl::sycl::cl_float4& a) {
75 return cl::sycl::cl_double2(a.x(), a.y());
83 #endif // EIGEN_TYPE_CASTING_SYCL_H Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1