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
This commit is contained in:
Aditya Atluri
2017-06-02 11:19:33 -05:00
parent c5f9758f4b
commit fdcc223842
2 ha cambiato i file con 12 aggiunte e 8 eliminazioni
@@ -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
@@ -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