Skip to content

Commit 8b065da

Browse files
authored
SWDEV-395996 - Support hip common headers with HIPRTC (#3277)
Change-Id: I7e78c5ad9d56e68c477b856d5cf8ade99dfddf08
1 parent 8f99508 commit 8b065da

File tree

8 files changed

+50
-8
lines changed

8 files changed

+50
-8
lines changed

include/hip/device_functions.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,9 @@ THE SOFTWARE.
2323
#ifndef HIP_INCLUDE_HIP_DEVICE_FUNCTIONS_H
2424
#define HIP_INCLUDE_HIP_DEVICE_FUNCTIONS_H
2525

26+
#if !defined(__HIPCC_RTC__)
2627
#include <hip/hip_common.h>
28+
#endif
2729

2830
#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
2931
#include <hip/amd_detail/amd_device_functions.h>

include/hip/driver_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,9 @@ THE SOFTWARE.
2323
#ifndef HIP_INCLUDE_HIP_DRIVER_TYPES_H
2424
#define HIP_INCLUDE_HIP_DRIVER_TYPES_H
2525

26+
#if !defined(__HIPCC_RTC__)
2627
#include <hip/hip_common.h>
28+
#endif
2729

2830
#if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
2931
#include "driver_types.h"

include/hip/hip_common.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -23,6 +23,10 @@ THE SOFTWARE.
2323
#ifndef HIP_INCLUDE_HIP_HIP_COMMON_H
2424
#define HIP_INCLUDE_HIP_HIP_COMMON_H
2525

26+
#if defined(__clang__)
27+
#pragma clang diagnostic push
28+
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
29+
#endif
2630
// Common code included at start of every hip file.
2731
// Auto enable __HIP_PLATFORM_AMD__ if compiling on AMD platform
2832
// Other compiler (GCC,ICC,etc) need to set one of these macros explicitly
@@ -99,4 +103,8 @@ THE SOFTWARE.
99103
#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (0)
100104
#endif
101105

106+
#if defined(__clang__)
107+
#pragma clang diagnostic pop
108+
#endif
109+
102110
#endif

include/hip/hip_complex.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,9 @@ THE SOFTWARE.
2323
#ifndef HIP_INCLUDE_HIP_HIP_COMPLEX_H
2424
#define HIP_INCLUDE_HIP_HIP_COMPLEX_H
2525

26+
#if !defined(__HIPCC_RTC__)
2627
#include <hip/hip_common.h>
28+
#endif
2729

2830
#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
2931
#include <hip/amd_detail/amd_hip_complex.h>

include/hip/library_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,9 @@ THE SOFTWARE.
2323
#ifndef HIP_INCLUDE_HIP_LIBRARY_TYPES_H
2424
#define HIP_INCLUDE_HIP_LIBRARY_TYPES_H
2525

26+
#if !defined(__HIPCC_RTC__)
2627
#include <hip/hip_common.h>
28+
#endif
2729

2830
#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
2931

include/hip/math_functions.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -27,7 +27,9 @@ THE SOFTWARE.
2727
// paths to provide a consistent include env and avoid "missing symbol" errors that only appears
2828
// on NVCC path:
2929

30+
#if !defined(__HIPCC_RTC__)
3031
#include <hip/hip_common.h>
32+
#endif
3133

3234
#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
3335
#include <hip/amd_detail/amd_math_functions.h>

include/hip/surface_types.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal
55
in the Software without restriction, including without limitation the rights
@@ -25,7 +25,14 @@ THE SOFTWARE.
2525
#ifndef HIP_INCLUDE_HIP_SURFACE_TYPES_H
2626
#define HIP_INCLUDE_HIP_SURFACE_TYPES_H
2727

28+
#if defined(__clang__)
29+
#pragma clang diagnostic push
30+
#pragma clang diagnostic ignored "-Wreserved-identifier"
31+
#endif
32+
33+
#if !defined(__HIPCC_RTC__)
2834
#include <hip/driver_types.h>
35+
#endif
2936

3037
/**
3138
* An opaque value that represents a hip surface object
@@ -49,4 +56,8 @@ enum hipSurfaceBoundaryMode {
4956
hipBoundaryModeClamp = 2
5057
};
5158

59+
#if defined(__clang__)
60+
#pragma clang diagnostic pop
61+
#endif
62+
5263
#endif /* !HIP_INCLUDE_HIP_SURFACE_TYPES_H */

include/hip/texture_types.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,16 @@ THE SOFTWARE.
2323
#ifndef HIP_INCLUDE_HIP_TEXTURE_TYPES_H
2424
#define HIP_INCLUDE_HIP_TEXTURE_TYPES_H
2525

26+
#if defined(__clang__)
27+
#pragma clang diagnostic push
28+
#pragma clang diagnostic ignored "-Wreserved-identifier"
29+
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
30+
#pragma clang diagnostic ignored "-Wc++98-compat"
31+
#endif
32+
33+
#if !defined(__HIPCC_RTC__)
2634
#include <hip/hip_common.h>
35+
#endif
2736

2837
#if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
2938
#include "texture_types.h"
@@ -179,4 +188,8 @@ struct __HIP_TEXTURE_ATTRIB texture : public textureReference {
179188
#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
180189
#endif
181190

191+
#if defined(__clang__)
192+
#pragma clang diagnostic pop
193+
#endif
194+
182195
#endif

0 commit comments

Comments
 (0)