From e805ff20fdfbfc910b5685caf9e3111244601135 Mon Sep 17 00:00:00 2001 From: Homer Hsing Date: Fri, 7 Dec 2012 09:17:07 +0800 Subject: [PATCH] add missing #define in ocl_stdlib.h: INLINE_OVERLOADABLE and OVERLOADABLE use INLINE_OVERLOADABLE in DECL --- backend/src/ocl_stdlib.h | 13 +++++++------ backend/src/ocl_stdlib_str.cpp | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/backend/src/ocl_stdlib.h b/backend/src/ocl_stdlib.h index 0633820..cf8d9ce 100644 --- a/backend/src/ocl_stdlib.h +++ b/backend/src/ocl_stdlib.h @@ -24,6 +24,7 @@ uint* Copyright © 2012 Intel Corporation #define OVERLOADABLE __attribute__((overloadable)) #define PURE __attribute__((pure)) #define CONST __attribute__((const)) +#define INLINE_OVERLOADABLE __attribute__((overloadable,always_inline)) ///////////////////////////////////////////////////////////////////////////// // OpenCL built-in scalar data types @@ -113,22 +114,22 @@ typedef size_t event_t; DECL(int4, float4); \ DECL(int8, float8); \ DECL(int16, float16); -#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isequal(type x, type y) { return x == y; } +#define DECL(ret, type) ret INLINE_OVERLOADABLE isequal(type x, type y) { return x == y; } DEF; #undef DECL -#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isnotequal(type x, type y) { return x != y; } +#define DECL(ret, type) ret INLINE_OVERLOADABLE isnotequal(type x, type y) { return x != y; } DEF; #undef DECL -#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isgreater(type x, type y) { return x > y; } +#define DECL(ret, type) ret INLINE_OVERLOADABLE isgreater(type x, type y) { return x > y; } DEF; #undef DECL -#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isgreaterequal(type x, type y) { return x >= y; } +#define DECL(ret, type) ret INLINE_OVERLOADABLE isgreaterequal(type x, type y) { return x >= y; } DEF; #undef DECL -#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isless(type x, type y) { return x < y; } +#define DECL(ret, type) ret INLINE_OVERLOADABLE isless(type x, type y) { return x < y; } DEF; #undef DECL -#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) islessequal(type x, type y) { return x <= y; } +#define DECL(ret, type) ret INLINE_OVERLOADABLE islessequal(type x, type y) { return x <= y; } DEF; #undef DECL #undef DEF diff --git a/backend/src/ocl_stdlib_str.cpp b/backend/src/ocl_stdlib_str.cpp index 2cd750c..0f97be4 100644 --- a/backend/src/ocl_stdlib_str.cpp +++ b/backend/src/ocl_stdlib_str.cpp @@ -27,6 +27,7 @@ std::string ocl_stdlib_str = "#define OVERLOADABLE __attribute__((overloadable))\n" "#define PURE __attribute__((pure))\n" "#define CONST __attribute__((const))\n" +"#define INLINE_OVERLOADABLE __attribute__((overloadable,always_inline))\n" "\n" "/////////////////////////////////////////////////////////////////////////////\n" "// OpenCL built-in scalar data types\n" @@ -117,22 +118,22 @@ std::string ocl_stdlib_str = " DECL(int4, float4); \\\n" " DECL(int8, float8); \\\n" " DECL(int16, float16);\n" -"#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isequal(type x, type y) { return x == y; }\n" +"#define DECL(ret, type) ret INLINE_OVERLOADABLE isequal(type x, type y) { return x == y; }\n" "DEF;\n" "#undef DECL\n" -"#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isnotequal(type x, type y) { return x != y; }\n" +"#define DECL(ret, type) ret INLINE_OVERLOADABLE isnotequal(type x, type y) { return x != y; }\n" "DEF;\n" "#undef DECL\n" -"#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isgreater(type x, type y) { return x > y; }\n" +"#define DECL(ret, type) ret INLINE_OVERLOADABLE isgreater(type x, type y) { return x > y; }\n" "DEF;\n" "#undef DECL\n" -"#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isgreaterequal(type x, type y) { return x >= y; }\n" +"#define DECL(ret, type) ret INLINE_OVERLOADABLE isgreaterequal(type x, type y) { return x >= y; }\n" "DEF;\n" "#undef DECL\n" -"#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) isless(type x, type y) { return x < y; }\n" +"#define DECL(ret, type) ret INLINE_OVERLOADABLE isless(type x, type y) { return x < y; }\n" "DEF;\n" "#undef DECL\n" -"#define DECL(ret, type) ret __attribute__((always_inline,overloadable)) islessequal(type x, type y) { return x <= y; }\n" +"#define DECL(ret, type) ret INLINE_OVERLOADABLE islessequal(type x, type y) { return x <= y; }\n" "DEF;\n" "#undef DECL\n" "#undef DEF\n" -- 2.7.4