Fix ambiguity of __clz and __clzll

This commit is contained in:
Yaxun Sam Liu
2018-08-31 14:21:26 -04:00
parent e2a23add02
commit 11c91c2fdd
3 changed files with 29 additions and 15 deletions
+15
View File
@@ -67,6 +67,21 @@ unsigned int firstbit_u64(unsigned long long int a) {
return pos;
}
// Check implicit conversion will not cause ambiguity.
__device__ void test_ambiguity() {
short s;
unsigned short us;
float f;
int i;
unsigned int ui;
__clz(f);
__clz(s);
__clz(us);
__clzll(f);
__clzll(i);
__clzll(ui);
}
__global__ void HIP_kernel(hipLaunchParm lp, unsigned int* a, unsigned int* b, unsigned int* c,
unsigned long long int* d, int width, int height) {
int x = blockDim.x * blockIdx.x + threadIdx.x;