Revert adoption of CUDA indexing in general - this can only work with later versions of the compiler, just like module based dispatch, and thus must be guarded against usage in earlier (e.g. 1.6) versions.
This commit is contained in:
@@ -381,27 +381,29 @@ __device__ void __threadfence_system(void) ;
|
||||
* @}
|
||||
*/
|
||||
|
||||
template<typename std::common_type<
|
||||
decltype(hc_get_group_id),
|
||||
decltype(hc_get_group_size),
|
||||
decltype(hc_get_num_groups),
|
||||
decltype(hc_get_workitem_id)>::type f>
|
||||
class Coordinates {
|
||||
using R = decltype(f(0));
|
||||
#if __hcc_workweek__ >= 17481
|
||||
template<typename std::common_type<
|
||||
decltype(hc_get_group_id),
|
||||
decltype(hc_get_group_size),
|
||||
decltype(hc_get_num_groups),
|
||||
decltype(hc_get_workitem_id)>::type f>
|
||||
class Coordinates {
|
||||
using R = decltype(f(0));
|
||||
|
||||
struct X { __device__ operator R() const { return f(0); } };
|
||||
struct Y { __device__ operator R() const { return f(1); } };
|
||||
struct Z { __device__ operator R() const { return f(2); } };
|
||||
public:
|
||||
static constexpr X x{};
|
||||
static constexpr Y y{};
|
||||
static constexpr Z z{};
|
||||
};
|
||||
struct X { __device__ operator R() const { return f(0); } };
|
||||
struct Y { __device__ operator R() const { return f(1); } };
|
||||
struct Z { __device__ operator R() const { return f(2); } };
|
||||
public:
|
||||
static constexpr X x{};
|
||||
static constexpr Y y{};
|
||||
static constexpr Z z{};
|
||||
};
|
||||
|
||||
static constexpr Coordinates<hc_get_group_size> blockDim;
|
||||
static constexpr Coordinates<hc_get_group_id> blockIdx;
|
||||
static constexpr Coordinates<hc_get_num_groups> gridDim;
|
||||
static constexpr Coordinates<hc_get_workitem_id> threadIdx;
|
||||
static constexpr Coordinates<hc_get_group_size> blockDim;
|
||||
static constexpr Coordinates<hc_get_group_id> blockIdx;
|
||||
static constexpr Coordinates<hc_get_num_groups> gridDim;
|
||||
static constexpr Coordinates<hc_get_workitem_id> threadIdx;
|
||||
#endif
|
||||
|
||||
#define hipThreadIdx_x (hc_get_workitem_id(0))
|
||||
#define hipThreadIdx_y (hc_get_workitem_id(1))
|
||||
|
||||
Reference in New Issue
Block a user