Skip to content

Commit 6e5f397

Browse files
authored
SWDEV-508958 - [6.4 Preview] remove unused standard headers (#59)
Change-Id: I0801701f0743a2b7da56696052291f60d693c24b
1 parent 946eae1 commit 6e5f397

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

include/hip/driver_types.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@ THE SOFTWARE.
2525

2626
#if !defined(__HIPCC_RTC__)
2727
#include <hip/hip_common.h>
28+
#if __cplusplus
29+
#include <cstdlib>
30+
#else
31+
#include <stdlib.h> // size_t
32+
#endif
2833
#endif
2934

3035
#if !defined(__HIP_PLATFORM_AMD__) && defined(__HIP_PLATFORM_NVIDIA__)
3136
#include "driver_types.h"
3237
#elif defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
3338

34-
#if !defined(__HIPCC_RTC__)
35-
#ifndef __cplusplus
36-
#include <stdbool.h>
37-
#endif
38-
#endif // !defined(__HIPCC_RTC__)
39-
4039
/**
4140
* @defgroup DriverTypes Driver Types
4241
* @{

include/hip/hip_runtime.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ THE SOFTWARE.
4545
// Some standard header files, these are included by hc.hpp and so want to make them avail on both
4646
// paths to provide a consistent include env and avoid "missing symbol" errors that only appears
4747
// on NVCC path:
48+
#if __cplusplus
49+
#include <cstdint>
50+
#include <cstdlib>
51+
#else
4852
#include <stdint.h>
49-
#include <stdio.h>
5053
#include <stdlib.h>
51-
#include <assert.h>
52-
53-
#if __cplusplus > 199711L
54-
#include <thread>
55-
#endif
54+
#endif // __cplusplus
5655
#endif // !defined(__HIPCC_RTC__)
5756

5857
#include <hip/hip_version.h>

include/hip/hip_runtime_api.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,16 @@ THE SOFTWARE.
3030
#ifndef HIP_INCLUDE_HIP_HIP_RUNTIME_API_H
3131
#define HIP_INCLUDE_HIP_HIP_RUNTIME_API_H
3232

33-
#include <string.h> // for getDeviceProp
33+
#if __cplusplus
34+
#include <climits>
35+
#include <cstdint>
36+
#include <cstdlib>
37+
#else
38+
#include <limits.h>
39+
#include <stdint.h>
40+
#include <stdlib.h>
41+
#endif
42+
3443
#include <hip/hip_version.h>
3544
#include <hip/hip_common.h>
3645
#include <hip/linker_types.h>
@@ -568,8 +577,6 @@ enum hipGPUDirectRDMAWritesOrdering {
568577

569578
#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
570579

571-
#include <stdint.h>
572-
#include <stddef.h>
573580
#ifndef GENERIC_GRID_LAUNCH
574581
#define GENERIC_GRID_LAUNCH 1
575582
#endif

include/hip/hiprtc.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ THE SOFTWARE.
2828
#include <hip/nvidia_detail/nvidia_hiprtc.h>
2929
#elif defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_PLATFORM_NVIDIA__)
3030

31+
#ifdef __cplusplus
32+
#include <cstdlib>
33+
#else
34+
#include <stdlib.h>
35+
#endif
36+
3137
#ifdef __cplusplus
3238
extern "C" {
3339
#endif /* __cplusplus */
3440

35-
#include <stdlib.h>
36-
3741
#if !defined(_WIN32)
3842
#pragma GCC visibility push(default)
3943
#endif

include/hip/texture_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ THE SOFTWARE.
4343
* *
4444
*******************************************************************************/
4545
#if !defined(__HIPCC_RTC__)
46-
#include <limits.h>
4746
#include <hip/channel_descriptor.h>
4847
#include <hip/driver_types.h>
4948
#endif // !defined(__HIPCC_RTC__)

0 commit comments

Comments
 (0)