forked from kokkos/kokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix atomic operations bug for Min and Max (kokkos#6435)
Fix atomic operations bug for Min and Max and add tests Co-authored-by: Daniel Arndt <arndtd@ornl.gov>
- Loading branch information
1 parent
ee8d58e
commit 8181d70
Showing
19 changed files
with
622 additions
and
1,731 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
core/unit_test/TestAtomicOperations_unsignedlonglongint.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//@HEADER | ||
// ************************************************************************ | ||
// | ||
// Kokkos v. 4.0 | ||
// Copyright (2022) National Technology & Engineering | ||
// Solutions of Sandia, LLC (NTESS). | ||
// | ||
// Under the terms of Contract DE-NA0003525 with NTESS, | ||
// the U.S. Government retains certain rights in this software. | ||
// | ||
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://kokkos.org/LICENSE for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//@HEADER | ||
|
||
#include <TestAtomicOperations.hpp> | ||
|
||
namespace Test { | ||
TEST(TEST_CATEGORY, atomic_operations_unsignedlonglong) { | ||
const int start = 0; | ||
const int end = 11; | ||
for (int i = start; i < end; ++i) { | ||
for (int t = 0; t < 16; t++) | ||
ASSERT_TRUE( | ||
(TestAtomicOperations::AtomicOperationsTestIntegralType< | ||
unsigned long long int, TEST_EXECSPACE>(i, end - i + start, t))); | ||
ASSERT_TRUE((TestAtomicOperations::AtomicOperationsTestUnsignedIntegralType< | ||
unsigned long long int, TEST_EXECSPACE>(i, end - i, | ||
1))); // Wrapping Inc | ||
ASSERT_TRUE((TestAtomicOperations::AtomicOperationsTestUnsignedIntegralType< | ||
unsigned long long int, TEST_EXECSPACE>(i, end - i, | ||
2))); // Wrapping Dec | ||
} | ||
} | ||
} // namespace Test |
Oops, something went wrong.