Skip to content

Commit 2e5c3a0

Browse files
yxsamliuiotamudelta
authored andcommitted
Fix device function declaration for hip-clang (ROCm#250)
1 parent 662e8f2 commit 2e5c3a0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

caffe2/utils/conversions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <caffe2/core/hip/common_gpu.h>
1212
#endif
1313

14-
#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__)
14+
#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) || defined(__HIP__)
1515
#define CONVERSIONS_DECL __host__ __device__ inline
1616
#else
1717
#define CONVERSIONS_DECL inline

caffe2/utils/fixed_divisor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <cstdio>
88
#include <cstdlib>
99

10-
#if defined(__CUDA_ARCH__) || defined(__HIP_ARCH__)
10+
#if defined(__CUDA_ARCH__) || defined(__HIP_ARCH__) || defined(__HIP__)
1111
#define FIXED_DIVISOR_DECL inline __host__ __device__
1212
#else
1313
#define FIXED_DIVISOR_DECL inline

caffe2/utils/math_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "caffe2/core/common.h"
55

6-
#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__)
6+
#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) || defined(__HIP__)
77
#define MATH_UTILS_DECL inline __host__ __device__
88
#else
99
#define MATH_UTILS_DECL inline

0 commit comments

Comments
 (0)