/* { dg-require-effective-target openacc_cudart } */
/* { dg-require-effective-target openacc_cuda } */
/* { dg-require-effective-target gomp_hip_header_nvidia } */
-/* { dg-additional-options "-lcuda -lcudart" } */
+/* { dg-additional-options "-lcuda -lcudart -Wno-deprecated-declarations" } */
#define __HIP_PLATFORM_NVIDIA__ 1
/* { dg-require-effective-target openacc_cublas } */
/* { dg-require-effective-target gomp_hip_header_nvidia } */
-/* { dg-additional-options "-lcublas" } */
+/* { dg-additional-options "-lcublas -Wno-deprecated-declarations" } */
#define __HIP_PLATFORM_NVIDIA__ 1
#include "../libgomp.c-c++-common/on_device_arch.h"
-#if __has_include(<hipblas/hipblas.h>) && !defined(USE_HIP_FALLBACK_HEADER)
+#if __has_include(<hipblas/hipblas.h>) && (__has_include(<library_types.h>) || !defined(__HIP_PLATFORM_NVIDIA__)) && !defined(USE_HIP_FALLBACK_HEADER)
+ #ifdef __HIP_PLATFORM_NVIDIA__
+ /* There seems to be an issue with hip/library_types.h including
+ CUDA's "library_types.h". Include CUDA's one explicitly here.
+ Could possibly worked around by using -isystem vs. -I. */
+ #include <library_types.h>
+
+ /* For some reasons, the following symbols do not seem to get
+ mapped from HIP to CUDA, causing link errors. */
+ #define hipblasSetStream cublasSetStream_v2
+ #define hipblasDaxpy cublasDaxpy_v2
+ #define hipblasCreate cublasCreate_v2
+ #endif
#include <hipblas/hipblas.h>
#elif defined(__HIP_PLATFORM_AMD__)