From 24ac8ab09a2e3d5c5e0610e6cc2d888285e1a44f Mon Sep 17 00:00:00 2001
From: Cory Bloor <Cordell.Bloor@amd.com>
Date: Thu, 19 Jan 2023 14:12:33 -0700
Subject: [PATCH] Fix reserved identifiers in include guards (#1600)

The include guards have been changed to the filename in uppercase
letters with all non-alphanumeric symbols replaced by underscore.
This include guard pattern matches the guard that is used for the
generated file rocsparse-export.h.

The C and C++ standards reserve all identifiers that begin with an
underscore followed by a capital letter [C99 §7.1.3]
[C++11 §17.6.4.3.2].

Applied-Upstream: https://github.com/ROCm/rocBLAS/commit/24ac8ab09a2e3d5c5e0610e6cc2d888285e1a44f
---
 library/include/internal/rocblas-auxiliary.h     | 8 ++++----
 library/include/internal/rocblas-beta.h          | 8 ++++----
 library/include/internal/rocblas-complex-types.h | 6 +++---
 library/include/internal/rocblas-functions.h     | 8 ++++----
 library/include/internal/rocblas-types.h         | 8 ++++----
 library/include/internal/rocblas-version.h.in    | 8 ++++----
 library/include/internal/rocblas_bfloat16.h      | 6 +++---
 library/include/rocblas.h                        | 8 ++++----
 8 files changed, 30 insertions(+), 30 deletions(-)

--- a/library/include/internal/rocblas-auxiliary.h
+++ b/library/include/internal/rocblas-auxiliary.h
@@ -1,5 +1,5 @@
 /* ************************************************************************
- * Copyright (C) 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (C) 2016-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,8 +20,8 @@
  *
  * ************************************************************************ */
 
-#ifndef _ROCBLAS_AUXILIARY_H_
-#define _ROCBLAS_AUXILIARY_H_
+#ifndef ROCBLAS_AUXILIARY_H
+#define ROCBLAS_AUXILIARY_H
 #include "rocblas-export.h"
 #include "rocblas-types.h"
 
@@ -402,4 +402,4 @@
 }
 #endif
 
-#endif /* _ROCBLAS_AUXILIARY_H_ */
+#endif /* ROCBLAS_AUXILIARY_H */
--- a/library/include/internal/rocblas-beta.h
+++ b/library/include/internal/rocblas-beta.h
@@ -1,5 +1,5 @@
 /* ************************************************************************
- * Copyright (C) 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (C) 2016-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,8 +20,8 @@
  *
  * ************************************************************************ */
 
-#ifndef _ROCBLAS_BETA_H_
-#define _ROCBLAS_BETA_H_
+#ifndef ROCBLAS_BETA_H
+#define ROCBLAS_BETA_H
 #include "rocblas-auxiliary.h"
 #include "rocblas-export.h"
 #include "rocblas-types.h"
@@ -450,4 +450,4 @@
 }
 #endif
 
-#endif /* _ROCBLAS_BETA_H_ */
+#endif /* ROCBLAS_BETA_H */
--- a/library/include/internal/rocblas-complex-types.h
+++ b/library/include/internal/rocblas-complex-types.h
@@ -24,8 +24,8 @@
  * \brief rocblas-complex-types.h defines complex data types used by rocblas
  */
 
-#ifndef _ROCBLAS_COMPLEX_TYPES_H_
-#define _ROCBLAS_COMPLEX_TYPES_H_
+#ifndef ROCBLAS_COMPLEX_TYPES_H
+#define ROCBLAS_COMPLEX_TYPES_H
 
 /* Workaround clang bug:
 
@@ -548,4 +548,4 @@
 
 #endif // using internal complex class for API
 
-#endif
+#endif /* ROCBLAS_COMPLEX_TYPES_H */
--- a/library/include/internal/rocblas-functions.h
+++ b/library/include/internal/rocblas-functions.h
@@ -1,5 +1,5 @@
 /* ************************************************************************
- * Copyright (C) 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (C) 2016-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,8 +20,8 @@
  *
  * ************************************************************************ */
 
-#ifndef _ROCBLAS_FUNCTIONS_H_
-#define _ROCBLAS_FUNCTIONS_H_
+#ifndef ROCBLAS_FUNCTIONS_H
+#define ROCBLAS_FUNCTIONS_H
 #include "rocblas-export.h"
 #include "rocblas-types.h"
 
@@ -18412,4 +18412,4 @@
 }
 #endif
 
-#endif /* _ROCBLAS_FUNCTIONS_H_ */
+#endif /* ROCBLAS_FUNCTIONS_H */
--- a/library/include/internal/rocblas-types.h
+++ b/library/include/internal/rocblas-types.h
@@ -1,5 +1,5 @@
 /* ************************************************************************
- * Copyright (C) 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (C) 2016-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
@@ -24,8 +24,8 @@
  * \brief rocblas-types.h defines data types used by rocblas
  */
 
-#ifndef _ROCBLAS_TYPES_H_
-#define _ROCBLAS_TYPES_H_
+#ifndef ROCBLAS_TYPES_H
+#define ROCBLAS_TYPES_H
 
 #include "rocblas-export.h"
 #include "rocblas_bfloat16.h"
@@ -334,4 +334,4 @@
 
 } rocblas_check_numerics_mode;
 
-#endif
+#endif /* ROCBLAS_TYPES_H */
--- a/library/include/internal/rocblas-version.h.in
+++ b/library/include/internal/rocblas-version.h.in
@@ -1,5 +1,5 @@
 /* ************************************************************************
- * Copyright (C) 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (C) 2016-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
@@ -22,8 +22,8 @@
 
 /* the configured version and settings
  */
-#ifndef ROCBLAS_VERSION_H_
-#define ROCBLAS_VERSION_H_
+#ifndef ROCBLAS_VERSION_H
+#define ROCBLAS_VERSION_H
 
 // clang-format off
 #define ROCBLAS_VERSION_MAJOR       @rocblas_VERSION_MAJOR@
@@ -33,4 +33,4 @@
 #define ROCBLAS_VERSION_COMMIT_ID   @rocblas_VERSION_COMMIT_ID@
 // clang-format on
 
-#endif
+#endif /* ROCBLAS_VERSION_H */
--- a/library/include/internal/rocblas_bfloat16.h
+++ b/library/include/internal/rocblas_bfloat16.h
@@ -24,8 +24,8 @@
  * \brief rocblas_bfloat16.h provides struct for rocblas_bfloat16 typedef
  */
 
-#ifndef _ROCBLAS_BFLOAT16_H_
-#define _ROCBLAS_BFLOAT16_H_
+#ifndef ROCBLAS_BFLOAT16_H
+#define ROCBLAS_BFLOAT16_H
 
 #if __cplusplus < 201103L || (!defined(__HCC__) && !defined(__HIPCC__))
 
@@ -293,4 +293,4 @@
 
 #endif // __cplusplus < 201103L || (!defined(__HCC__) && !defined(__HIPCC__))
 
-#endif // _ROCBLAS_BFLOAT16_H_
+#endif // ROCBLAS_BFLOAT16_H
--- a/library/include/rocblas.h
+++ b/library/include/rocblas.h
@@ -1,5 +1,5 @@
 /* ************************************************************************
- * Copyright (C) 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (C) 2016-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
@@ -24,8 +24,8 @@
  * \brief rocblas.h includes other *.h and exposes a common interface
  */
 
-#ifndef _ROCBLAS_H_
-#define _ROCBLAS_H_
+#ifndef ROCBLAS_H
+#define ROCBLAS_H
 
 /* library headers */
 #include "internal/rocblas-auxiliary.h"
@@ -38,4 +38,4 @@
 #include "internal/rocblas-beta.h"
 #endif
 
-#endif // _ROCBLAS_H_
+#endif /* ROCBLAS_H */
