diff options
author | Homer Hsing <homer.xing@intel.com> | 2013-10-31 11:12:54 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-10-31 12:38:02 +0800 |
commit | 9934f1bf8c0bb19a7602f8c05e35e59ef75a19cd (patch) | |
tree | 6c0d2d4849728eaeb589ef65e08b5644d5470550 | |
parent | ab01a1569d4cf1155c3910e44ed32e0f70aafd9f (diff) | |
download | beignet-9934f1bf8c0bb19a7602f8c05e35e59ef75a19cd.tar.gz |
add same type converting
converting a data type to same type ...
Signed-off-by: Homer Hsing <homer.xing@intel.com>
Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
-rwxr-xr-x | backend/src/gen_convert.sh | 3 | ||||
-rw-r--r-- | backend/src/ocl_convert.h | 40 |
2 files changed, 40 insertions, 3 deletions
diff --git a/backend/src/gen_convert.sh b/backend/src/gen_convert.sh index 0d84e50f..30d8876b 100755 --- a/backend/src/gen_convert.sh +++ b/backend/src/gen_convert.sh @@ -9,9 +9,6 @@ for vector_length in $VECTOR_LENGTHS; do fbasetype=`IFS=:; set -- dummy $ftype; echo $2` for ttype in $TYPES; do tbasetype=`IFS=:; set -- dummy $ttype; echo $2` - if test $fbasetype = $tbasetype; then - continue - fi echo "INLINE OVERLOADABLE $tbasetype convert_$tbasetype($fbasetype v) {" echo " return ($tbasetype)v;" echo "}" diff --git a/backend/src/ocl_convert.h b/backend/src/ocl_convert.h index 76519c44..d78d697b 100644 --- a/backend/src/ocl_convert.h +++ b/backend/src/ocl_convert.h @@ -1,5 +1,9 @@ // This file is autogenerated by gen_convert.sh. // Don't modify it manually. +INLINE OVERLOADABLE long convert_long(long v) { + return (long)v; +} + INLINE OVERLOADABLE ulong convert_ulong(long v) { return (ulong)v; } @@ -40,6 +44,10 @@ INLINE OVERLOADABLE long convert_long(ulong v) { return (long)v; } +INLINE OVERLOADABLE ulong convert_ulong(ulong v) { + return (ulong)v; +} + INLINE OVERLOADABLE int convert_int(ulong v) { return (int)v; } @@ -80,6 +88,10 @@ INLINE OVERLOADABLE ulong convert_ulong(int v) { return (ulong)v; } +INLINE OVERLOADABLE int convert_int(int v) { + return (int)v; +} + INLINE OVERLOADABLE uint convert_uint(int v) { return (uint)v; } @@ -120,6 +132,10 @@ INLINE OVERLOADABLE int convert_int(uint v) { return (int)v; } +INLINE OVERLOADABLE uint convert_uint(uint v) { + return (uint)v; +} + INLINE OVERLOADABLE short convert_short(uint v) { return (short)v; } @@ -160,6 +176,10 @@ INLINE OVERLOADABLE uint convert_uint(short v) { return (uint)v; } +INLINE OVERLOADABLE short convert_short(short v) { + return (short)v; +} + INLINE OVERLOADABLE ushort convert_ushort(short v) { return (ushort)v; } @@ -200,6 +220,10 @@ INLINE OVERLOADABLE short convert_short(ushort v) { return (short)v; } +INLINE OVERLOADABLE ushort convert_ushort(ushort v) { + return (ushort)v; +} + INLINE OVERLOADABLE char convert_char(ushort v) { return (char)v; } @@ -240,6 +264,10 @@ INLINE OVERLOADABLE ushort convert_ushort(char v) { return (ushort)v; } +INLINE OVERLOADABLE char convert_char(char v) { + return (char)v; +} + INLINE OVERLOADABLE uchar convert_uchar(char v) { return (uchar)v; } @@ -280,6 +308,10 @@ INLINE OVERLOADABLE char convert_char(uchar v) { return (char)v; } +INLINE OVERLOADABLE uchar convert_uchar(uchar v) { + return (uchar)v; +} + INLINE OVERLOADABLE double convert_double(uchar v) { return (double)v; } @@ -320,6 +352,10 @@ INLINE OVERLOADABLE uchar convert_uchar(double v) { return (uchar)v; } +INLINE OVERLOADABLE double convert_double(double v) { + return (double)v; +} + INLINE OVERLOADABLE float convert_float(double v) { return (float)v; } @@ -360,6 +396,10 @@ INLINE OVERLOADABLE double convert_double(float v) { return (double)v; } +INLINE OVERLOADABLE float convert_float(float v) { + return (float)v; +} + INLINE OVERLOADABLE long2 convert_long2(long2 v) { return v; } INLINE OVERLOADABLE ulong2 convert_ulong2(long2 v) { return (ulong2)((ulong)(v.s0), (ulong)(v.s1)); |