-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix performance for CUDA >= 9.2 (master) (#1327)
- sets `GT_CONSTEXPR` to `constexpr` for nvcc - introduces `const_ref` to fix performance for CUDA >= 9.2 (`T` for small data types, `T const&` for large data types)
- Loading branch information
Showing
52 changed files
with
3,433 additions
and
3,405 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
31 changes: 31 additions & 0 deletions
31
include/gridtools/common/generic_metafunctions/const_ref.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,31 @@ | ||
/* | ||
* GridTools | ||
* | ||
* Copyright (c) 2014-2019, ETH Zurich | ||
* All rights reserved. | ||
* | ||
* Please, refer to the LICENSE file in the root directory. | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <type_traits> | ||
|
||
#include "../../meta/macros.hpp" | ||
#include "../../meta/type_traits.hpp" | ||
|
||
namespace gridtools { | ||
namespace lazy { | ||
template <class T, class = void> | ||
struct const_ref : std::add_lvalue_reference<std::add_const_t<T>> {}; | ||
|
||
template <class T> | ||
struct const_ref<T, | ||
std::enable_if_t<!std::is_reference<T>::value && std::is_trivially_copy_constructible<T>::value && | ||
sizeof(T) <= sizeof(std::add_pointer_t<T>)>> : std::add_const<T> {}; | ||
} // namespace lazy | ||
|
||
template <class T> | ||
using const_ref = typename lazy::const_ref<T>::type; | ||
} // namespace gridtools |
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
Oops, something went wrong.