Merge branch 'feature_use_module_based_dispatch_instead_of_pfe' of https://github.com/AlexVlx/HIP into feature_use_module_based_dispatch_instead_of_pfe
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))
|
||||
|
||||
مرجع در شماره جدید
Block a user