Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1From 77c581a3ebd47b5e2908973b70adea66891159ee Mon Sep 17 00:00:00 2001
2From: Jatin Chaudhary <JatinJaikishan.Chaudhary@amd.com>
3Date: Mon, 4 Dec 2023 17:21:39 +0000
4Subject: [PATCH] SWDEV-435702 - the functions in bf16 header need to be static
5
6If the compiler decides not to inline these functions, we might break ODR (one definition rule) due to this file being included in multiple files and being linked together
7
8Change-Id: Iacbfdabb53f5b4e5db8c690b23f3730ec9af16c0
9---
10 hipamd/include/hip/amd_detail/amd_hip_bf16.h | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/hipamd/include/hip/amd_detail/amd_hip_bf16.h b/hipamd/include/hip/amd_detail/amd_hip_bf16.h
14index 836e090eb..204269a84 100644
15--- a/hipamd/include/hip/amd_detail/amd_hip_bf16.h
16+++ b/hipamd/include/hip/amd_detail/amd_hip_bf16.h
17@@ -94,12 +94,12 @@
18 #include "math_fwd.h" // ocml device functions
19
20 #if defined(__HIPCC_RTC__)
21-#define __HOST_DEVICE__ __device__
22+#define __HOST_DEVICE__ __device__ static
23 #else
24 #include <algorithm>
25 #include <climits>
26 #include <cmath>
27-#define __HOST_DEVICE__ __host__ __device__ inline
28+#define __HOST_DEVICE__ __host__ __device__ static inline
29 #endif
30
31 #define HIPRT_ONE_BF16 __float2bfloat16(1.0f)