EXSWHTEC-307 - Implement tests for printf and __hip_hc_<add/sub/mul>8pk device functions (#274)
Change-Id: I4669d3f0f8cc062e75cd2b0a8aeee51868dd5b09
[ROCm/hip-tests commit: 08a41abaad]
This commit is contained in:
committed by
Rakesh Roy
parent
9c05d62e68
commit
d6f8998c85
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
static constexpr auto kPrintfParam{
|
||||
R"(
|
||||
struct Dummy {
|
||||
__device__ Dummy() {}
|
||||
__device__ ~Dummy() {}
|
||||
};
|
||||
__global__ void printf_n1(int* p) { printf(p); }
|
||||
__global__ void printf_n2(unsigned int* p) { printf(p); }
|
||||
__global__ void printf_n3(short* p) { printf(p); }
|
||||
__global__ void printf_n4(long* p) { printf(p); }
|
||||
__global__ void printf_n5(unsigned long* p) { printf(p); }
|
||||
__global__ void printf_n6(long long* p) { printf(p); }
|
||||
__global__ void printf_n7(unsigned long long* p) { printf(p); }
|
||||
__global__ void printf_n8(float* p) { printf(p); }
|
||||
__global__ void printf_n9(double* p) { printf(p); }
|
||||
__global__ void printf_n10(long double* p) { printf(p); }
|
||||
__global__ void printf_n11(Dummy* p) { printf(p); }
|
||||
)"};
|
||||
Reference in New Issue
Block a user