21 #ifndef EIGEN_TYPE_CASTING_SYCL_H
22 #define EIGEN_TYPE_CASTING_SYCL_H
24 #include "../../InternalHeaderCheck.h"
29 #ifdef SYCL_DEVICE_ONLY
31 struct type_casting_traits<float, int> {
32 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
37 pcast<cl::sycl::cl_float4, cl::sycl::cl_int4>(
const cl::sycl::cl_float4&
a) {
39 .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 };
49 pcast<cl::sycl::cl_int4, cl::sycl::cl_float4>(
const cl::sycl::cl_int4&
a) {
50 return a.template convert<cl::sycl::cl_float,
51 cl::sycl::rounding_mode::automatic>();
55 struct type_casting_traits<double, float> {
56 enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 };
61 pcast<cl::sycl::cl_double2, cl::sycl::cl_float4>(
62 const cl::sycl::cl_double2&
a,
const cl::sycl::cl_double2&
b) {
63 auto a1 =
a.template convert<cl::sycl::cl_float,
64 cl::sycl::rounding_mode::automatic>();
65 auto b1 =
b.template convert<cl::sycl::cl_float,
66 cl::sycl::rounding_mode::automatic>();
67 return cl::sycl::cl_float4(a1.x(), a1.y(), b1.x(), b1.y());
71 struct type_casting_traits<float, double> {
72 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 };
77 pcast<cl::sycl::cl_float4, cl::sycl::cl_double2>(
const cl::sycl::cl_float4&
a) {
79 return cl::sycl::cl_double2(
a.x(),
a.y());
#define EIGEN_ALWAYS_INLINE
#define EIGEN_DEVICE_FUNC