Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix clang CUDA atomics #1773

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions include/alpaka/atomic/AtomicUniformCudaHip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ inline namespace alpakaGlobal
}
};


# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicSub,
Expand All @@ -181,6 +181,7 @@ inline namespace alpakaGlobal
return atomicSub_block(add, value);
}
};
# endif

// Min.
template<typename T, typename THierarchy>
Expand All @@ -197,6 +198,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicMin,
Expand All @@ -210,6 +212,7 @@ inline namespace alpakaGlobal
return atomicMin_block(add, value);
}
};
# endif

// disable HIP atomicMin: see https://github.com/ROCm-Developer-Tools/hipamd/pull/40
# if(BOOST_LANG_HIP)
Expand Down Expand Up @@ -262,6 +265,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicMax,
Expand All @@ -275,6 +279,7 @@ inline namespace alpakaGlobal
return atomicMax_block(add, value);
}
};
# endif

// disable HIP atomicMax: see https://github.com/ROCm-Developer-Tools/hipamd/pull/40
# if(BOOST_LANG_HIP)
Expand Down Expand Up @@ -328,6 +333,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicExch,
Expand All @@ -341,6 +347,7 @@ inline namespace alpakaGlobal
return atomicExch_block(add, value);
}
};
# endif

// Inc.

Expand All @@ -358,6 +365,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicInc,
Expand All @@ -371,6 +379,7 @@ inline namespace alpakaGlobal
return atomicInc_block(add, value);
}
};
# endif

// Dec.

Expand All @@ -388,6 +397,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicDec,
Expand All @@ -401,6 +411,7 @@ inline namespace alpakaGlobal
return atomicDec_block(add, value);
}
};
# endif

// And.

Expand All @@ -418,6 +429,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicAnd,
Expand All @@ -431,7 +443,7 @@ inline namespace alpakaGlobal
return atomicAnd_block(add, value);
}
};

# endif

// Or.

Expand All @@ -449,6 +461,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicOr,
Expand All @@ -462,7 +475,7 @@ inline namespace alpakaGlobal
return atomicOr_block(add, value);
}
};

# endif

// Xor.

Expand All @@ -480,6 +493,7 @@ inline namespace alpakaGlobal
}
};

# if !CLANG_CUDA_PTX_WORKAROUND
template<typename T>
struct AlpakaBuiltInAtomic<
alpaka::AtomicXor,
Expand All @@ -493,6 +507,7 @@ inline namespace alpakaGlobal
return atomicXor_block(add, value);
}
};
# endif

} // namespace alpakaGlobal

Expand Down