From 14281c0a404436844960f84e0fa5ddad10c3837b Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 17 Jul 2018 17:21:10 +0100 Subject: [PATCH 1/2] Not yet. --- .../include/hip/hcc_detail/hip_vector_types.h | 73 ++++++------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/hipamd/include/hip/hcc_detail/hip_vector_types.h b/hipamd/include/hip/hcc_detail/hip_vector_types.h index 60d53f4885..dc93b5697c 100644 --- a/hipamd/include/hip/hcc_detail/hip_vector_types.h +++ b/hipamd/include/hip/hcc_detail/hip_vector_types.h @@ -683,60 +683,33 @@ __MAKE_VECTOR_TYPE__(longlong, long long); __MAKE_VECTOR_TYPE__(float, float); __MAKE_VECTOR_TYPE__(double, double); -#if defined(__cplusplus) - #define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x) { return type{x}; } - #define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x, comp y) { return type{x, y}; } +#define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x) { type r = {x}; return r; } - #define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x, comp y, comp z) { return type{x, y, z}; } +#define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x, comp y) { type r = {x, y}; return r; } - #define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x, comp y, comp z, comp w) { \ - return type{x, y, z, w}; \ - } -#else - #define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x) { type r = {x}; return r; } +#define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x, comp y, comp z) { type r = {x, y, z}; return r; } - #define DECLOP_MAKE_TWO_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x, comp y) { type r = {x, y}; return r; } - - #define DECLOP_MAKE_THREE_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x, comp y, comp z) { type r = {x, y, z}; return r; } - - #define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ - __device__ __host__ \ - static \ - inline \ - type make_##type(comp x, comp y, comp z, comp w) { \ - type r = {x, y, z, w}; \ - return r; \ - } -#endif +#define DECLOP_MAKE_FOUR_COMPONENT(comp, type) \ + __device__ __host__ \ + static \ + inline \ + type make_##type(comp x, comp y, comp z, comp w) { \ + type r = {x, y, z, w}; \ + return r; \ + } DECLOP_MAKE_ONE_COMPONENT(unsigned char, uchar1); DECLOP_MAKE_TWO_COMPONENT(unsigned char, uchar2); From 252776d4aa969e40d08c79b66ce834e1c1b63aa4 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 17 Jul 2018 17:28:48 +0100 Subject: [PATCH 2/2] Update hip_vector_types.h --- hipamd/include/hip/hcc_detail/hip_vector_types.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hipamd/include/hip/hcc_detail/hip_vector_types.h b/hipamd/include/hip/hcc_detail/hip_vector_types.h index dc93b5697c..7b05c7db3d 100644 --- a/hipamd/include/hip/hcc_detail/hip_vector_types.h +++ b/hipamd/include/hip/hcc_detail/hip_vector_types.h @@ -683,7 +683,6 @@ __MAKE_VECTOR_TYPE__(longlong, long long); __MAKE_VECTOR_TYPE__(float, float); __MAKE_VECTOR_TYPE__(double, double); - #define DECLOP_MAKE_ONE_COMPONENT(comp, type) \ __device__ __host__ \ static \ @@ -771,4 +770,4 @@ DECLOP_MAKE_TWO_COMPONENT(signed long, longlong2); DECLOP_MAKE_THREE_COMPONENT(signed long, longlong3); DECLOP_MAKE_FOUR_COMPONENT(signed long, longlong4); -#endif \ No newline at end of file +#endif