Move warpSize to header, have shuffles use default warpsize.
Этот коммит содержится в:
@@ -108,6 +108,12 @@ THE SOFTWARE.
|
||||
#define __HCC_C__
|
||||
#endif
|
||||
|
||||
|
||||
// TODO - hipify-clang - change to use the function call.
|
||||
//#define warpSize hc::__wavesize()
|
||||
const int warpSize = 64;
|
||||
|
||||
|
||||
#define clock_t long long int
|
||||
__device__ inline long long int clock64() { return (long long int)hc::__clock_u64(); };
|
||||
__device__ inline clock_t clock() { return (clock_t)hc::__clock_u64(); };
|
||||
@@ -344,42 +350,42 @@ __device__ inline unsigned long long int __ballot( int input)
|
||||
}
|
||||
|
||||
// warp shuffle functions
|
||||
__device__ inline int __shfl(int input, int lane, int width)
|
||||
__device__ inline int __shfl(int input, int lane, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl(input,lane,width);
|
||||
}
|
||||
|
||||
__device__ inline int __shfl_up(int input, unsigned int lane_delta, int width)
|
||||
__device__ inline int __shfl_up(int input, unsigned int lane_delta, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl_up(input,lane_delta,width);
|
||||
}
|
||||
|
||||
__device__ inline int __shfl_down(int input, unsigned int lane_delta, int width)
|
||||
__device__ inline int __shfl_down(int input, unsigned int lane_delta, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl_down(input,lane_delta,width);
|
||||
}
|
||||
|
||||
__device__ inline int __shfl_xor(int input, int lane_mask, int width)
|
||||
__device__ inline int __shfl_xor(int input, int lane_mask, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl_xor(input,lane_mask,width);
|
||||
}
|
||||
|
||||
__device__ inline float __shfl(float input, int lane, int width)
|
||||
__device__ inline float __shfl(float input, int lane, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl(input,lane,width);
|
||||
}
|
||||
|
||||
__device__ inline float __shfl_up(float input, unsigned int lane_delta, int width)
|
||||
__device__ inline float __shfl_up(float input, unsigned int lane_delta, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl_up(input,lane_delta,width);
|
||||
}
|
||||
|
||||
__device__ inline float __shfl_down(float input, unsigned int lane_delta, int width)
|
||||
__device__ inline float __shfl_down(float input, unsigned int lane_delta, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl_down(input,lane_delta,width);
|
||||
}
|
||||
|
||||
__device__ inline float __shfl_xor(float input, int lane_mask, int width)
|
||||
__device__ inline float __shfl_xor(float input, int lane_mask, int width=warpSize)
|
||||
{
|
||||
return hc::__shfl_xor(input,lane_mask,width);
|
||||
}
|
||||
@@ -438,7 +444,6 @@ __device__ inline float __dsqrt_rz(double x) {return hc::fast_math::sqrt(x); };
|
||||
#define hipGridDim_z (hc_get_num_groups(0))
|
||||
|
||||
|
||||
extern int warpSize ;
|
||||
|
||||
|
||||
#define __syncthreads() hc_barrier(CLK_LOCAL_MEM_FENCE)
|
||||
|
||||
Ссылка в новой задаче
Block a user