From fdcc2238421fc0bb29f170ff4e2106999ad3bb9d Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Fri, 2 Jun 2017 11:19:33 -0500 Subject: [PATCH] added half data type and vector destructors 1. Added half data types to hip_fp16.h 2. Added destructor to vector data types Change-Id: Id5ae76a663bb90a4bde2839ec79c58fbaee5072f --- hipamd/include/hip/hcc_detail/hip_fp16.h | 1 + .../include/hip/hcc_detail/hip_vector_types.h | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/hipamd/include/hip/hcc_detail/hip_fp16.h b/hipamd/include/hip/hcc_detail/hip_fp16.h index a1abce2191..b1ecc61cb0 100644 --- a/hipamd/include/hip/hcc_detail/hip_fp16.h +++ b/hipamd/include/hip/hcc_detail/hip_fp16.h @@ -28,6 +28,7 @@ THE SOFTWARE. typedef __fp16 __half; typedef __fp16 __half1 __attribute__((ext_vector_type(1))); typedef __fp16 __half2 __attribute__((ext_vector_type(2))); +typedef __fp16 half; /* Half Arithmetic Functions diff --git a/hipamd/include/hip/hcc_detail/hip_vector_types.h b/hipamd/include/hip/hcc_detail/hip_vector_types.h index 3c3b26c12a..9da34d9f32 100644 --- a/hipamd/include/hip/hcc_detail/hip_vector_types.h +++ b/hipamd/include/hip/hcc_detail/hip_vector_types.h @@ -37,38 +37,41 @@ THE SOFTWARE. #define MAKE_DEFAULT_CONSTRUCTOR_ONE_COMPONENT(type) \ __device__ __host__ type() {} \ __device__ __host__ type(type& val) : x(val.x) { } \ -__device__ __host__ type(const type& val) : x(val.x) { } +__device__ __host__ type(const type& val) : x(val.x) { } \ +__device__ __host__ ~type() {} #define MAKE_DEFAULT_CONSTRUCTOR_TWO_COMPONENT(type) \ __device__ __host__ type() {} \ __device__ __host__ type(type& val) : x(val.x), y(val.y) { } \ -__device__ __host__ type(const type& val) : x(val.x), y(val.y) { } +__device__ __host__ type(const type& val) : x(val.x), y(val.y) { } \ +__device__ __host__ ~type() {} #define MAKE_DEFAULT_CONSTRUCTOR_THREE_COMPONENT(type) \ __device__ __host__ type() {} \ __device__ __host__ type(type& val) : x(val.x), y(val.y), z(val.z) { } \ -__device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z) { } +__device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z) { } \ +__device__ __host__ ~type() {} #define MAKE_DEFAULT_CONSTRUCTOR_FOUR_COMPONENT(type) \ __device__ __host__ type() {} \ __device__ __host__ type(type& val) : x(val.x), y(val.y), z(val.z), w(val.w) { } \ -__device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z), w(val.w) { } - +__device__ __host__ type(const type& val) : x(val.x), y(val.y), z(val.z), w(val.w) { } \ +__device__ __host__ ~type() {} #define MAKE_COMPONENT_CONSTRUCTOR_ONE_COMPONENT(type, type1) \ __device__ __host__ type(type1 val) : x(val) {} \ #define MAKE_COMPONENT_CONSTRUCTOR_TWO_COMPONENT(type, type1) \ __device__ __host__ type(type1 val) : x(val), y(val) {} \ -__device__ __host__ type(type1 val1, type1 val2) : x(val1), y(val2) {} +__device__ __host__ type(type1 val1, type1 val2) : x(val1), y(val2) {} \ #define MAKE_COMPONENT_CONSTRUCTOR_THREE_COMPONENT(type, type1) \ __device__ __host__ type(type1 val) : x(val), y(val), z(val) {} \ -__device__ __host__ type(type1 val1, type1 val2, type1 val3) : x(val1), y(val2), z(val3) {} +__device__ __host__ type(type1 val1, type1 val2, type1 val3) : x(val1), y(val2), z(val3) {} \ #define MAKE_COMPONENT_CONSTRUCTOR_FOUR_COMPONENT(type, type1) \ __device__ __host__ type(type1 val) : x(val), y(val), z(val), w(val) {} \ -__device__ __host__ type(type1 val1, type1 val2, type1 val3, type1 val4) : x(val1), y(val2), z(val3), w(val4) {} +__device__ __host__ type(type1 val1, type1 val2, type1 val3, type1 val4) : x(val1), y(val2), z(val3), w(val4) {} \ struct uchar1 { #ifdef __cplusplus