Merge pull request #603 from b-sumner/master

Drop use of NVCC_COMPAT since it is always set
This commit is contained in:
Maneesh Gupta
2018-08-03 08:45:18 +05:30
committed by GitHub
5 changed files with 0 additions and 73 deletions
-13
View File
@@ -86,28 +86,15 @@ int main(int argc, char* argv[]) {
printf("warp no. %d __all = %d \n", i, host_all[i]);
if (host_all[i] != 1) ++allcount;
#if defined(__HIP_PLATFORM_HCC__) && !defined(NVCC_COMPAT)
if (host_any[i] != 64) ++anycount;
#else
if (host_any[i] != 1) ++anycount;
#endif
}
#if defined(__HIP_PLATFORM_HCC__) && !defined(NVCC_COMPAT)
if (anycount == 1 && allcount == 1)
printf("PASSED\n");
else {
printf("FAILED\n");
return EXIT_FAILURE;
}
#else
if (anycount == 0 && allcount == 1)
printf("PASSED\n");
else {
printf("FAILED\n");
return EXIT_FAILURE;
}
#endif
return EXIT_SUCCESS;
}
-9
View File
@@ -45,12 +45,7 @@ THE SOFTWARE.
unsigned int firstbit_u32(unsigned int a) {
if (a == 0) {
#if defined(__HIP_PLATFORM_HCC__) && !defined(NVCC_COMPAT)
return -1;
#else
return 32;
#endif
}
unsigned int pos = 0;
while ((int)a > 0) {
@@ -62,11 +57,7 @@ unsigned int firstbit_u32(unsigned int a) {
unsigned int firstbit_u64(unsigned long long int a) {
if (a == 0) {
#if defined(__HIP_PLATFORM_HCC__) && !defined(NVCC_COMPAT)
return -1;
#else
return 64;
#endif
}
unsigned int pos = 0;
while ((long long int)a > 0) {
-8
View File
@@ -49,21 +49,13 @@ THE SOFTWARE.
template <typename T>
int lastbit(T a) {
if (a == 0)
#if defined(__HIP_PLATFORM_HCC__) && !defined(NVCC_COMPAT)
return -1;
#else
return 0;
#endif
int pos = 1;
while ((a & 1) != 1) {
a >>= 1;
pos++;
}
#if defined(__HIP_PLATFORM_HCC__) && !defined(NVCC_COMPAT)
return pos - 1;
#else
return pos;
#endif
}