Add USE_PROMOTE_FREE_HCC for smooth transition to new HCC caps.

ADDRESS_SPACE_1 defines
This commit is contained in:
Ben Sander
2017-03-17 11:04:39 -05:00
parent c9f64bbd2d
commit f4256cb57c
4 changed files with 25 additions and 11 deletions
+14 -5
View File
@@ -47,7 +47,16 @@ THE SOFTWARE.
#include <hip/hip_runtime_api.h>
//#include "hip/hcc_detail/hip_hcc.h"
#define USE_PROMOTE_FREE_HCC 0
#if USE_PROMOTE_FREE_HCC == 1
#define ADDRESS_SPACE_1
#define ADDRESS_SPACE_3
#else
#define ADDRESS_SPACE_1 __attribute__((address_space(1)))
#define ADDRESS_SPACE_3 __attribute__((address_space(3)))
#endif
//---
// Remainder of this file only compiles with HCC
#ifdef __HCC__
@@ -275,7 +284,7 @@ __device__ int __hip_move_dpp(int src, int dpp_ctrl, int row_mask, int bank_mask
__host__ __device__ int min(int arg1, int arg2);
__host__ __device__ int max(int arg1, int arg2);
__device__ __attribute__((address_space(3))) void* __get_dynamicgroupbaseptr();
__device__ ADDRESS_SPACE_3 void* __get_dynamicgroupbaseptr();
/**
@@ -433,10 +442,10 @@ do {\
// Macro to replace extern __shared__ declarations
// to local variable definitions
#define HIP_DYNAMIC_SHARED(type, var) \
__attribute__((address_space(3))) type* var = \
(__attribute__((address_space(3))) type*)__get_dynamicgroupbaseptr(); \
ADDRESS_SPACE_3 type* var = \
ADDRESS_SPACE_3 type*)__get_dynamicgroupbaseptr(); \
#define HIP_DYNAMIC_SHARED_ATTRIBUTE __attribute__((address_space(3)))
#define HIP_DYNAMIC_SHARED_ATTRIBUTE ADDRESS_SPACE_3
#endif // __HCC__
+5 -1
View File
@@ -47,7 +47,11 @@ THE SOFTWARE.
*/
// _restrict is supported by the compiler
#define __shared__ tile_static
#define __constant__ __attribute__((address_space(1)))
#if USE_PROMOTE_FREE_HCC==1
#define __constant__ __attribute__((hc))
#else
#define __constant__ ADDRESS_SPACE_1
#endif
#else
// Non-HCC compiler