From d12651521f5b91af4e6872751e4bc982100070eb Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Thu, 16 Jun 2016 16:18:35 +0530 Subject: [PATCH 1/2] Add compiler annotations to make_ functions Change-Id: Ic16cfe402dc5cb387b1b63ad311ce8b57ea07361 --- include/hcc_detail/hip_vector_types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hcc_detail/hip_vector_types.h b/include/hcc_detail/hip_vector_types.h index 0d1ad97663..1537b0fb70 100644 --- a/include/hcc_detail/hip_vector_types.h +++ b/include/hcc_detail/hip_vector_types.h @@ -185,10 +185,10 @@ __HIP_DEVICE__ double4 make_double4(double, double, double, double ); /* ///--- // Inline functions for creating vector types from basic types -#define ONE_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x) { VT t; t.x = x; return t; }; -#define TWO_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x, T y) { VT t; t.x=x; t.y=y; return t; }; -#define THREE_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x, T y, T z) { VT t; t.x=x; t.y=y; t.z=z; return t; }; -#define FOUR_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x, T y, T z, T w) { VT t; t.x=x; t.y=y; t.z=z; t.w=w; return t; }; +#define ONE_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT [[hc]] [[cpu]] (T x) { VT t; t.x = x; return t; }; +#define TWO_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT [[hc]] [[cpu]] (T x, T y) { VT t; t.x=x; t.y=y; return t; }; +#define THREE_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT [[hc]] [[cpu]] (T x, T y, T z) { VT t; t.x=x; t.y=y; t.z=z; return t; }; +#define FOUR_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT [[hc]] [[cpu]] (T x, T y, T z, T w) { VT t; t.x=x; t.y=y; t.z=z; t.w=w; return t; }; //signed: From 59c483aa16fc97e7cee0730ad4e8a66b5af0cda7 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 17 Jun 2016 14:11:46 +0530 Subject: [PATCH 2/2] hipLaunchKernel supports empty kernel with no arguments Change-Id: Iaa46ced7fe0e3d72734d02250dfb48b98bef615d --- include/hcc_detail/hip_runtime.h | 4 ++-- include/nvcc_detail/hip_runtime.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hcc_detail/hip_runtime.h b/include/hcc_detail/hip_runtime.h index aa634cdf1e..51d4be40c3 100644 --- a/include/hcc_detail/hip_runtime.h +++ b/include/hcc_detail/hip_runtime.h @@ -526,7 +526,7 @@ do {\ fprintf(stderr, KGRN "<>>(0, __VA_ARGS__);\ +kernelName<<>>(0, ##__VA_ARGS__);\ } while(0)