Skip to content

Commit b8f7a3b

Browse files
author
Justin Lebar
committedJan 5, 2017
[CUDA] Rename keywords used in macro so they don't conflict with MSVC.
Summary: MSVC seems to use "__in" and "__out" for its own purposes, so we have to pick different names in this macro. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28325 llvm-svn: 291138
1 parent 11d5116 commit b8f7a3b

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed
 

‎clang/lib/Headers/__clang_cuda_intrinsics.h

+21-21
Original file line numberDiff line numberDiff line change
@@ -35,50 +35,50 @@
3535

3636
#pragma push_macro("__MAKE_SHUFFLES")
3737
#define __MAKE_SHUFFLES(__FnName, __IntIntrinsic, __FloatIntrinsic, __Mask) \
38-
inline __device__ int __FnName(int __in, int __offset, \
38+
inline __device__ int __FnName(int __val, int __offset, \
3939
int __width = warpSize) { \
40-
return __IntIntrinsic(__in, __offset, \
40+
return __IntIntrinsic(__val, __offset, \
4141
((warpSize - __width) << 8) | (__Mask)); \
4242
} \
43-
inline __device__ float __FnName(float __in, int __offset, \
43+
inline __device__ float __FnName(float __val, int __offset, \
4444
int __width = warpSize) { \
45-
return __FloatIntrinsic(__in, __offset, \
45+
return __FloatIntrinsic(__val, __offset, \
4646
((warpSize - __width) << 8) | (__Mask)); \
4747
} \
48-
inline __device__ unsigned int __FnName(unsigned int __in, int __offset, \
48+
inline __device__ unsigned int __FnName(unsigned int __val, int __offset, \
4949
int __width = warpSize) { \
5050
return static_cast<unsigned int>( \
51-
::__FnName(static_cast<int>(__in), __offset, __width)); \
51+
::__FnName(static_cast<int>(__val), __offset, __width)); \
5252
} \
53-
inline __device__ long long __FnName(long long __in, int __offset, \
53+
inline __device__ long long __FnName(long long __val, int __offset, \
5454
int __width = warpSize) { \
5555
struct __Bits { \
5656
int __a, __b; \
5757
}; \
58-
_Static_assert(sizeof(__in) == sizeof(__Bits)); \
58+
_Static_assert(sizeof(__val) == sizeof(__Bits)); \
5959
_Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \
6060
__Bits __tmp; \
61-
memcpy(&__in, &__tmp, sizeof(__in)); \
61+
memcpy(&__val, &__tmp, sizeof(__val)); \
6262
__tmp.__a = ::__FnName(__tmp.__a, __offset, __width); \
6363
__tmp.__b = ::__FnName(__tmp.__b, __offset, __width); \
64-
long long __out; \
65-
memcpy(&__out, &__tmp, sizeof(__tmp)); \
66-
return __out; \
64+
long long __ret; \
65+
memcpy(&__ret, &__tmp, sizeof(__tmp)); \
66+
return __ret; \
6767
} \
6868
inline __device__ unsigned long long __FnName( \
69-
unsigned long long __in, int __offset, int __width = warpSize) { \
70-
return static_cast<unsigned long long>( \
71-
::__FnName(static_cast<unsigned long long>(__in), __offset, __width)); \
69+
unsigned long long __val, int __offset, int __width = warpSize) { \
70+
return static_cast<unsigned long long>(::__FnName( \
71+
static_cast<unsigned long long>(__val), __offset, __width)); \
7272
} \
73-
inline __device__ double __FnName(double __in, int __offset, \
73+
inline __device__ double __FnName(double __val, int __offset, \
7474
int __width = warpSize) { \
7575
long long __tmp; \
76-
_Static_assert(sizeof(__tmp) == sizeof(__in)); \
77-
memcpy(&__tmp, &__in, sizeof(__in)); \
76+
_Static_assert(sizeof(__tmp) == sizeof(__val)); \
77+
memcpy(&__tmp, &__val, sizeof(__val)); \
7878
__tmp = ::__FnName(__tmp, __offset, __width); \
79-
double __out; \
80-
memcpy(&__out, &__tmp, sizeof(__out)); \
81-
return __out; \
79+
double __ret; \
80+
memcpy(&__ret, &__tmp, sizeof(__ret)); \
81+
return __ret; \
8282
}
8383

8484
__MAKE_SHUFFLES(__shfl, __nvvm_shfl_idx_i32, __nvvm_shfl_idx_f32, 0x1f);

0 commit comments

Comments
 (0)
Please sign in to comment.