From 702b9eff1e4af40169e85084e8516d22d0d3078f Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Tue, 21 Jun 2016 16:04:04 -0500 Subject: [PATCH] Use GRID_LAUNCH_VERSION define provided by HCC grid_launch.h Change-Id: I5a7b31f13c4055cdca3a8854728d59db7dc5a7bb --- include/hcc_detail/hip_runtime.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/hcc_detail/hip_runtime.h b/include/hcc_detail/hip_runtime.h index 8594954e75..21da60631a 100644 --- a/include/hcc_detail/hip_runtime.h +++ b/include/hcc_detail/hip_runtime.h @@ -38,8 +38,6 @@ THE SOFTWARE. #include -// Use field names for grid_launch 2.0 structure: -#define USE_GRID_LAUNCH_20 0 #define CUDA_SUCCESS hipSuccess @@ -50,6 +48,16 @@ THE SOFTWARE. // Remainder of this file only compiles with HCC #ifdef __HCC__ #include + +#if defined (GRID_LAUNCH_VERSION) and (GRID_LAUNCH_VERSION >= 20) +// Use field names for grid_launch 2.0 structure, if HCC supports GL 2.0. +#define USE_GRID_LAUNCH_20 1 +#else +#define USE_GRID_LAUNCH_20 0 +#endif + + + extern int HIP_TRACE_API; //TODO-HCC-GL - change this to typedef. @@ -529,7 +537,7 @@ do {\ hipStream_t trueStream = (ihipPreLaunchKernel(_stream, _numBlocks3D, _blockDim3D, &lp)); \ if (HIP_TRACE_API) {\ fprintf(stderr, KGRN "<