Skip to content

Commit f2b84d5

Browse files
authored
Merge pull request #15 from stoneyang/hl_device_func
fixed build issue of double definition of atomicAdd on modern GPUs
2 parents df82689 + f2aa274 commit f2b84d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

paddle/cuda/include/hl_device_functions.cuh

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ limitations under the License. */
1616
#ifndef HL_DEVICE_FUNCTIONS_CUH_
1717
#define HL_DEVICE_FUNCTIONS_CUH_
1818

19+
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600
20+
1921
namespace hppl {
2022

2123
static __inline__ __device__ double atomicAdd(double* address, double val) {
@@ -38,4 +40,6 @@ static __inline__ __device__ double atomicAdd(double* address, double val) {
3840

3941
using hppl::atomicAdd;
4042

43+
#endif
44+
4145
#endif /* HL_DEVICE_FUNCTIONS_CUH_ */

0 commit comments

Comments
 (0)