From 21c414d40b6897cc6ae05caefa4248363c98fc5c Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 26 Oct 2023 15:46:43 +0200 Subject: [PATCH] [HIPIFY][tests][BLAS][fix] Move `__nv_bfloat16`-related APIs under `#if CUDA_VERSION >= 11000` [Synopsis] + cublas2hipblas.cu, cublas2hipblas_v2.cu, and cublas2rocblas.cu tests fail against CUDA < 11.0 [Reason] + `__nv_bfloat16` type appeared in CUDA 11.0 only --- .../synthetic/libraries/cublas2hipblas.cu | 22 ++++++------ .../synthetic/libraries/cublas2hipblas_v2.cu | 22 ++++++------ .../synthetic/libraries/cublas2rocblas.cu | 36 +++++++++---------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu b/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu index f13bf182..c2a76068 100644 --- a/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu +++ b/tests/unit_tests/synthetic/libraries/cublas2hipblas.cu @@ -246,17 +246,6 @@ int main() { // CHECK: __half** hyarray = 0; __half** hyarray = 0; - // CHECK: hip_bfloat16** bf16Aarray = 0; - __nv_bfloat16** bf16Aarray = 0; - // CHECK: const hip_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); - const __nv_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); - // CHECK: hip_bfloat16** bf16xarray = 0; - __nv_bfloat16** bf16xarray = 0; - // CHECK: const hip_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); - const __nv_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); - // CHECK: hip_bfloat16** bf16yarray = 0; - __nv_bfloat16** bf16yarray = 0; - double da = 0; double dA = 0; double db = 0; @@ -1658,6 +1647,17 @@ int main() { cublasDataType_t R_16BF = CUDA_R_16BF; cublasDataType_t C_16BF = CUDA_C_16BF; + // CHECK: hip_bfloat16** bf16Aarray = 0; + __nv_bfloat16** bf16Aarray = 0; + // CHECK: const hip_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); + const __nv_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); + // CHECK: hip_bfloat16** bf16xarray = 0; + __nv_bfloat16** bf16xarray = 0; + // CHECK: const hip_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); + const __nv_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); + // CHECK: hip_bfloat16** bf16yarray = 0; + __nv_bfloat16** bf16yarray = 0; + // CHECK: hipblasComputeType_t blasComputeType; cublasComputeType_t blasComputeType; diff --git a/tests/unit_tests/synthetic/libraries/cublas2hipblas_v2.cu b/tests/unit_tests/synthetic/libraries/cublas2hipblas_v2.cu index d302096b..060bc9ef 100644 --- a/tests/unit_tests/synthetic/libraries/cublas2hipblas_v2.cu +++ b/tests/unit_tests/synthetic/libraries/cublas2hipblas_v2.cu @@ -257,17 +257,6 @@ int main() { // CHECK: __half** hyarray = 0; __half** hyarray = 0; - // CHECK: hip_bfloat16** bf16Aarray = 0; - __nv_bfloat16** bf16Aarray = 0; - // CHECK: const hip_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); - const __nv_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); - // CHECK: hip_bfloat16** bf16xarray = 0; - __nv_bfloat16** bf16xarray = 0; - // CHECK: const hip_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); - const __nv_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); - // CHECK: hip_bfloat16** bf16yarray = 0; - __nv_bfloat16** bf16yarray = 0; - double da = 0; double dA = 0; double db = 0; @@ -1813,6 +1802,17 @@ int main() { cublasDataType_t R_16BF = CUDA_R_16BF; cublasDataType_t C_16BF = CUDA_C_16BF; + // CHECK: hip_bfloat16** bf16Aarray = 0; + __nv_bfloat16** bf16Aarray = 0; + // CHECK: const hip_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); + const __nv_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); + // CHECK: hip_bfloat16** bf16xarray = 0; + __nv_bfloat16** bf16xarray = 0; + // CHECK: const hip_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); + const __nv_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); + // CHECK: hip_bfloat16** bf16yarray = 0; + __nv_bfloat16** bf16yarray = 0; + // CHECK: hipblasComputeType_t blasComputeType; cublasComputeType_t blasComputeType; diff --git a/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu b/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu index ec9ed03a..0841e7c1 100644 --- a/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu +++ b/tests/unit_tests/synthetic/libraries/cublas2rocblas.cu @@ -278,24 +278,6 @@ int main() { // CHECK: rocblas_half** hyarray = 0; __half** hyarray = 0; - // CHECK: rocblas_bfloat16* bf16A = 0; - __nv_bfloat16* bf16A = 0; - // CHECK: rocblas_bfloat16* bf16x = 0; - __nv_bfloat16* bf16x = 0; - // CHECK: rocblas_bfloat16* bf16y = 0; - __nv_bfloat16* bf16y = 0; - - // CHECK: rocblas_bfloat16** bf16Aarray = 0; - __nv_bfloat16** bf16Aarray = 0; - // CHECK: const rocblas_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); - const __nv_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); - // CHECK: rocblas_bfloat16** bf16xarray = 0; - __nv_bfloat16** bf16xarray = 0; - // CHECK: const rocblas_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); - const __nv_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); - // CHECK: rocblas_bfloat16** bf16yarray = 0; - __nv_bfloat16** bf16yarray = 0; - double da = 0; double dA = 0; double db = 0; @@ -1793,6 +1775,24 @@ int main() { cublasDataType_t R_16BF = CUDA_R_16BF; cublasDataType_t C_16BF = CUDA_C_16BF; + // CHECK: rocblas_bfloat16* bf16A = 0; + __nv_bfloat16* bf16A = 0; + // CHECK: rocblas_bfloat16* bf16x = 0; + __nv_bfloat16* bf16x = 0; + // CHECK: rocblas_bfloat16* bf16y = 0; + __nv_bfloat16* bf16y = 0; + + // CHECK: rocblas_bfloat16** bf16Aarray = 0; + __nv_bfloat16** bf16Aarray = 0; + // CHECK: const rocblas_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); + const __nv_bfloat16** const bf16Aarray_const = const_cast(bf16Aarray); + // CHECK: rocblas_bfloat16** bf16xarray = 0; + __nv_bfloat16** bf16xarray = 0; + // CHECK: const rocblas_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); + const __nv_bfloat16** const bf16xarray_const = const_cast(bf16xarray_const); + // CHECK: rocblas_bfloat16** bf16yarray = 0; + __nv_bfloat16** bf16yarray = 0; + // CHECK: rocblas_computetype blasComputeType; // CHECK-NEXT: rocblas_computetype BLAS_COMPUTE_32F = rocblas_compute_type_f32; cublasComputeType_t blasComputeType;