Add support for few CUDA compatible reduction operations like __syncthreads_count()

Change-Id: I0917820058f0edad5c0bdd42dea37f06353fc63c
이 커밋은 다음에 포함됨:
mshivama 작성하고 Mahesha Shivamallappa가 2020-07-14 12:03:14 -04:00를 커밋함
1 부모 9ba3732180
커밋 1c5537dde4
5 파일이 변경됨
+508

검색과 일치하는 파일 없음

+24
파일 보기
@@ -1131,6 +1131,30 @@ void __syncthreads()
__barrier(__CLK_LOCAL_MEM_FENCE);
}
__device__
inline
__attribute__((convergent))
int __syncthreads_count(int predicate)
{
return __ockl_wgred_add_i32(!!predicate);
}
__device__
inline
__attribute__((convergent))
int __syncthreads_and(int predicate)
{
return __ockl_wgred_and_i32(!!predicate);
}
__device__
inline
__attribute__((convergent))
int __syncthreads_or(int predicate)
{
return __ockl_wgred_or_i32(!!predicate);
}
// hip.amdgcn.bc - device routine
/*
HW_ID Register bit structure
+5
파일 보기
@@ -74,6 +74,11 @@ extern "C" __device__ __attribute__((convergent)) void __ockl_multi_grid_sync(vo
extern "C" __device__ void __ockl_atomic_add_noret_f32(float*, float);
extern "C" __device__ __attribute__((convergent)) int __ockl_wgred_add_i32(int a);
extern "C" __device__ __attribute__((convergent)) int __ockl_wgred_and_i32(int a);
extern "C" __device__ __attribute__((convergent)) int __ockl_wgred_or_i32(int a);
// Introduce local address space
#define __local __attribute__((address_space(3)))