-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Vc math overloads to algebra-plugins
- Loading branch information
1 parent
328dd04
commit be6de46
Showing
19 changed files
with
302 additions
and
89 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
/** Detray library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace algebra::boolean { | ||
|
||
/// Utilities for single booleans: default case | ||
/// @{ | ||
constexpr bool any_of(bool b) { | ||
return b; | ||
} | ||
constexpr bool all_of(bool b) { | ||
return b; | ||
} | ||
constexpr bool none_of(bool b) { | ||
return !b; | ||
} | ||
/// @} | ||
|
||
} // namespace algebra::boolean |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
/** Detray library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Project include(s). | ||
#include "algebra/math/boolean.hpp" | ||
|
||
// Vc include(s). | ||
#ifdef _MSC_VER | ||
#pragma warning(push, 0) | ||
#endif // MSVC | ||
#include <Vc/Vc> | ||
#ifdef _MSC_VER | ||
#pragma warning(pop) | ||
#endif // MSVC | ||
|
||
namespace algebra::boolean_soa { | ||
|
||
/// Boolean utilities on single values | ||
/// @{ | ||
using algebra::boolean::all_of; | ||
using algebra::boolean::any_of; | ||
using algebra::boolean::none_of; | ||
/// @} | ||
|
||
/// Vc overloads of boolean utilities | ||
/// @{ | ||
template <typename T> | ||
requires Vc::Traits::is_simd_mask<T>::value | ||
inline bool any_of(T &&mask) { | ||
return Vc::any_of(std::forward<T>(mask)); | ||
} | ||
|
||
template <typename T> | ||
requires Vc::Traits::is_simd_mask<T>::value | ||
inline bool all_of(T &&mask) { | ||
return Vc::all_of(std::forward<T>(mask)); | ||
} | ||
|
||
template <typename T> | ||
requires Vc::Traits::is_simd_mask<T>::value | ||
inline bool none_of(T &&mask) { | ||
return Vc::none_of(std::forward<T>(mask)); | ||
} | ||
/// @} | ||
|
||
} // namespace algebra::boolean_soa |
Oops, something went wrong.