EXSWHTEC-307 - Implement tests for printf and __hip_hc_<add/sub/mul>8pk device functions (#274)

Change-Id: I4669d3f0f8cc062e75cd2b0a8aeee51868dd5b09


[ROCm/hip-tests commit: 08a41abaad]
Tento commit je obsažen v:
Nives Vukovic
2023-12-07 16:26:55 +00:00
odevzdal Rakesh Roy
rodič 9c05d62e68
revize d6f8998c85
19 změnil soubory, kde provedl 884 přidání a 20 odebrání
+10 -4
Zobrazit soubor
@@ -1,5 +1,5 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <hip/hip_runtime.h>
#include <hip_test_context.hh>
__global__ void test_kernel() {
const char* N = nullptr;
@@ -36,9 +36,13 @@ __global__ void test_kernel() {
printf("%%c%s\n", "xyzzy");
printf("%c%c%c\n", 's', 'e', 'p');
printf("%d\n", -42);
printf("%i\n", -42);
printf("%u\n", 42);
printf("%o\n", 42);
printf("%x\n", 42);
printf("%X\n", 42);
printf("%f\n", 123.456);
#ifdef __HIP_PLATFORM_AMD__
#if HT_AMD
printf("%F\n", -123.456);
#else
printf("%f\n", -123.456);
@@ -47,10 +51,12 @@ __global__ void test_kernel() {
printf("%E\n", 123.456);
printf("%g\n", 123.456);
printf("%G\n", -123.456);
printf("%a\n", 123.456);
printf("%A\n", -123.456);
printf("%c\n", 'x');
printf("%s\n", N);
printf("%p\n", (void *)N);
#ifdef __HIP_PLATFORM_AMD__
#if HT_AMD
printf("%.*f %*.*s %p\n", 8, 3.14159, 8, 5, s, (void*)0xf01dab1eca55e77e);
#else
// In Cuda, printf doesn't support %.*, %*.*