SWDEV-294588 - Enable NV printf DTests

Enable NV printf DTests as many as possible.
Fix the bugs due to behavour difference between
Hip-Rocclr and Cuda.
Add hipLimitPrintfFifoSize.

Change-Id: I3fe6dbc35a7a140a9919df197b7885df83d28049
This commit is contained in:
Tao Sang
2021-07-12 22:51:48 -04:00
committed by Tao Sang
parent b7c0b21814
commit 586165ebc2
9 changed files with 173 additions and 24 deletions
+9 -2
View File
@@ -21,8 +21,8 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s EXCLUDE_HIP_PLATFORM nvidia
* TEST: %t EXCLUDE_HIP_PLATFORM nvidia
* BUILD: %t %s
* TEST: %t
* HIT_END
*/
@@ -31,9 +31,16 @@ THE SOFTWARE.
__global__ void test_kernel() {
printf("%*d\n", 16, 42);
#ifdef __HIP_PLATFORM_AMD__
printf("%.*d\n", 8, 42);
printf("%*.*d\n", -16, 8, 42);
printf("%*.*f %s * %.*s\n", 16, 8, 123.456, "hello", 5, "worldxyz");
#else
// In Cuda, printf doesn't support %.*, %*.*
printf("%.8d\n", 42);
printf("%-16.8d\n", 42);
printf("%16.8f %s * %.5s\n", 123.456, "hello", "worldxyz");
#endif
}
int main(int argc, char **argv) {