Skip to content

Commit

Permalink
Merge pull request #285 from chillenzer/update-pre-commit
Browse files Browse the repository at this point in the history
Update pre commit
  • Loading branch information
psychocoderHPC authored Feb 6, 2025
2 parents 47f00cb + 32284d8 commit a35207d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ minimum_pre_commit_version: 3.2.0 # necessitated by Lucas-C's hooks
default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.7
hooks:
- id: clang-format
files: \.(cpp|hpp)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: no-commit-to-branch
args: [-b, dev]
Expand All @@ -21,7 +21,7 @@ repos:
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: forbid-tabs
- id: remove-tabs
Expand All @@ -31,7 +31,7 @@ repos:
hooks:
- id: check-useless-excludes
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
rev: v0.15.0
hooks:
- id: yamlfmt
- repo: https://github.com/adrienverge/yamllint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ namespace mallocMC::CreationPolicies::FlatterScatterAlloc
auto const index = pageIndex(pointer);
if(index >= static_cast<int32_t>(numPages()) || index < 0)
{
#if(!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
#if (!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
throw std::runtime_error{
"Attempted to destroy an invalid pointer! Pointer does not point to any page."};
#endif // NDEBUG
Expand Down Expand Up @@ -597,7 +597,8 @@ namespace mallocMC::CreationPolicies::FlatterScatterAlloc
startIndex,
numPages(),
noFreePageFound(),
[this, numBytes, &chunkSizeCache](auto const& localAcc, auto const index) {
[this, numBytes, &chunkSizeCache](auto const& localAcc, auto const index)
{
return this->thisPageIsSuitable(localAcc, index, numBytes, chunkSizeCache) ? index
: noFreePageFound();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ namespace mallocMC::CreationPolicies::FlatterScatterAlloc
{
if(chunkSize == 0)
{
#if(!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
#if (!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
throw std::runtime_error{
"Attempted to destroy a pointer with chunkSize==0. Likely this page was recently "
"(and potentially pre-maturely) freed."};
#endif // NDEBUG
return;
}
auto chunkIndex = chunkNumberOf(pointer);
#if(!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
#if (!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
if(not isValid(acc, chunkIndex))
{
throw std::runtime_error{"Attempted to destroy an invalid pointer! Either the pointer does not point "
Expand Down
2 changes: 1 addition & 1 deletion include/mallocMC/distributionPolicies/XMallocSIMD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace mallocMC
// within one page necessary for offset calculation
bool const coalescible = bytes > 0 && bytes < (pagesize / 32);

#if(MALLOCMC_DEVICE_COMPILE)
#if (MALLOCMC_DEVICE_COMPILE)
threadcount = alpaka::popcount(alpaka::warp::ballot(acc, coalescible));
#else
threadcount = 1; // TODO
Expand Down
4 changes: 2 additions & 2 deletions include/mallocMC/mallocMC_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* only is used to detect the device compile path.
* Since we require devices with support for ballot we can high-jack __HIP_ARCH_HAS_WARP_BALLOT__.
*/
#if(defined(__HIP_ARCH_HAS_WARP_BALLOT__) || defined(__CUDA_ARCH__) || __HIP_DEVICE_COMPILE__ == 1)
#if (defined(__HIP_ARCH_HAS_WARP_BALLOT__) || defined(__CUDA_ARCH__) || __HIP_DEVICE_COMPILE__ == 1)
# define MALLOCMC_DEVICE_COMPILE 1
#endif

Expand All @@ -66,7 +66,7 @@ namespace mallocMC
#endif

#ifdef ALPAKA_ACC_GPU_HIP_ENABLED
# if(HIP_VERSION_MAJOR >= 4)
# if (HIP_VERSION_MAJOR >= 4)
template<typename TDim, typename TIdx>
constexpr uint32_t warpSize<alpaka::AccGpuHipRt<TDim, TIdx>> = __AMDGCN_WAVEFRONT_SIZE;
# else
Expand Down
4 changes: 2 additions & 2 deletions test/unit/source/AccessBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ TEMPLATE_LIST_TEST_CASE("AccessBlock", "", AccessBlocks)
// the bit mask. Thus, the following test would corrupt the bit mask, if we were to allocate this in
// chunked mode.

#if(!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
#if (!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
REQUIRE(sizeof(BitMaskStorageType<>) > 1U);
auto localChunkSize = pageSize - 1U;
auto slots = accessBlock.getAvailableSlots(accSerial, localChunkSize);
Expand Down Expand Up @@ -469,7 +469,7 @@ TEMPLATE_LIST_TEST_CASE("AccessBlock", "", AccessBlocks)

SECTION("no invalid pointer but throws instead.")
{
#if(!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
#if (!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
pointer = nullptr;
CHECK_THROWS(
accessBlock.destroy(accSerial, pointer),
Expand Down
2 changes: 1 addition & 1 deletion test/unit/source/PageInterpretation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ TEST_CASE("PageInterpretation.destroy")
PageInterpretation<pageSize> page{data, chunkSize};
auto* pointer = page.create(accSerial);

#if(!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
#if (!defined(NDEBUG) && !BOOST_LANG_CUDA && !BOOST_LANG_HIP)
SECTION("throws if given an invalid pointer.")
{
pointer = nullptr;
Expand Down

0 comments on commit a35207d

Please sign in to comment.