2
0

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

Change-Id: I4669d3f0f8cc062e75cd2b0a8aeee51868dd5b09
Este cometimento está contido em:
Nives Vukovic
2023-12-07 16:26:55 +00:00
cometido por Rakesh Roy
ascendente 30f427277b
cometimento 08a41abaad
19 ficheiros modificados com 884 adições e 20 eliminações
+10 -4
Ver ficheiro
@@ -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 %.*, %*.*