-
Notifications
You must be signed in to change notification settings - Fork 110
Thread loop optimizations RAJA launch #1949
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
Open
artv3
wants to merge
35
commits into
develop
Choose a base branch
from
artv3/launch-loop-opt
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+571
−249
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
cd5065e
initial commit for launch loop optimization
artv3 484ff1a
add structs to store gpu thread/block info in launch ctx
artv3 18f332b
add cuda variant and add build guards for cpu
artv3 21f6184
Merge branch 'develop' into artv3/launch-loop-opt
artv3 73f224a
rework to support dim3 copy in ctx
artv3 8a02fee
Merge branch 'artv3/launch-loop-opt' of https://github.com/LLNL/RAJA …
artv3 1fbe50b
minor clean up pass
artv3 672889e
make format
artv3 5908a20
Update include/RAJA/pattern/launch/launch_core.hpp
artv3 316e019
Merge branch 'develop' into artv3/launch-loop-opt
rhornung67 4d9f800
clean up pass
artv3 d9ce271
update with develop and fix merge conflicts
artv3 85aef5a
fix build error
artv3 0469302
take develop submodule
artv3 4a695f2
cuda backend
artv3 f91a498
make style
artv3 d21c41f
omp backend
artv3 40a5c1b
seq backend + make style
artv3 e0f4825
clean up pass
artv3 96e99d5
Update include/RAJA/pattern/launch/launch_context_policy.hpp
artv3 a9f0cca
minor clean up
artv3 7d4595b
minor clean up
artv3 c23f76f
Merge branch 'artv3/launch-loop-opt' of github.com:LLNL/RAJA into art…
artv3 c990a4f
revert changes to example
artv3 f7939fd
remove specialization from launch policy
artv3 c24331c
make work for function pointers
artv3 0518138
store dim3 based on launch context type - hip
artv3 d5da29a
rework omp backend
artv3 af88dbb
update sequential backend
artv3 21ad0a8
get things building for cuda -- need a good clean up pass
artv3 646a95b
cuda clean up pass
artv3 597641b
clean up ordering in hip launch
artv3 5403737
clean up ordering
artv3 e41e970
make style
artv3 7c95430
use constexpt for getting dim values
artv3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,124 @@ | ||
| /*! | ||
| ****************************************************************************** | ||
| * | ||
| * \file | ||
| * | ||
| * \brief RAJA header file containing template types of RAJA::LaunchContextT | ||
| * | ||
| ****************************************************************************** | ||
| */ | ||
|
|
||
| //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
| // Copyright (c) 2016-25, Lawrence Livermore National Security, LLC | ||
| // and RAJA project contributors. See the RAJA/LICENSE file for details. | ||
| // | ||
| // SPDX-License-Identifier: (BSD-3-Clause) | ||
| //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
|
|
||
| #ifndef RAJA_pattern_context_policy_HPP | ||
| #define RAJA_pattern_context_policy_HPP | ||
|
|
||
| namespace RAJA | ||
| { | ||
|
|
||
| template<typename LaunchContextPolicy> | ||
| class LaunchContextT; | ||
|
|
||
| class LaunchContextDefaultPolicy; | ||
|
|
||
| #if defined(RAJA_CUDA_ACTIVE) || defined(RAJA_HIP_ACTIVE) | ||
| class LaunchContextDim3Policy; | ||
| #endif | ||
|
|
||
| namespace detail | ||
| { | ||
|
|
||
|
|
||
| template<typename T, typename = void> | ||
| struct has_single_call_operator : std::false_type | ||
| {}; | ||
|
|
||
| template<typename T> | ||
| struct has_single_call_operator< | ||
| T, | ||
| std::enable_if_t< | ||
| !std::is_same_v<decltype(&std::decay_t<T>::operator()), void>>> | ||
| : std::true_type | ||
| {}; | ||
|
|
||
| template<typename T> | ||
| struct function_traits | ||
| {}; | ||
|
|
||
| template<typename R, typename... Args> | ||
| struct function_traits<R(Args...)> | ||
| { | ||
| using result_type = R; | ||
| static constexpr std::size_t arity = sizeof...(Args); | ||
|
|
||
| template<std::size_t N> | ||
| struct arg | ||
| { | ||
| static_assert(N < arity, "argument index out of range"); | ||
| using type = typename std::tuple_element<N, std::tuple<Args...>>::type; | ||
| }; | ||
| }; | ||
|
|
||
| template<typename R, typename... Args> | ||
| struct function_traits<R (*)(Args...)> : function_traits<R(Args...)> | ||
| {}; | ||
|
|
||
| template<typename R, typename... Args> | ||
| struct function_traits<R (&)(Args...)> : function_traits<R(Args...)> | ||
| {}; | ||
|
|
||
| template<typename C, typename R, typename... Args> | ||
| struct function_traits<R (C::*)(Args...) const> : function_traits<R(Args...)> | ||
| { | ||
| using functional_type = C; | ||
| }; | ||
|
|
||
| template<typename C, typename R, typename... Args> | ||
| struct function_traits<R (C::*)(Args...)> : function_traits<R(Args...)> | ||
| { | ||
| using functional_type = C; | ||
| }; | ||
|
|
||
| template<typename T, | ||
| bool hasCallOp = has_single_call_operator<std::decay_t<T>>::value> | ||
| struct functional_traits : function_traits<std::decay_t<T>> | ||
| {}; | ||
|
|
||
| template<typename T> | ||
| struct functional_traits<T, true> | ||
| : function_traits<decltype(&std::decay_t<T>::operator())> | ||
| {}; | ||
|
|
||
| template<typename T, typename = void> | ||
| struct has_arg0 : std::false_type | ||
| {}; | ||
|
|
||
| template<typename T> | ||
| struct has_arg0<T, | ||
| typename std::enable_if_t<!std::is_same_v< | ||
| typename functional_traits<T>::template arg<0>::type, | ||
| void>>> : std::true_type | ||
| {}; | ||
|
|
||
| template<typename T, bool HasArg0 = has_arg0<T>::value> | ||
| struct launch_context_type | ||
| { | ||
| using type = LaunchContextT<LaunchContextDefaultPolicy>; | ||
| }; | ||
|
|
||
| template<typename T> | ||
| struct launch_context_type<T, true> | ||
| { | ||
| using type = typename functional_traits<T>::template arg<0>::type; | ||
| }; | ||
|
|
||
|
|
||
| } // namespace detail | ||
|
|
||
| } // namespace RAJA | ||
| #endif | ||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.