Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
f6d08f4b
There was an error fetching the commit references. Please try again later.
Commit
f6d08f4b
authored
6 years ago
by
Jakub Klinkovský
Committed by
Jakub Klinkovský
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
NDArray: generalized call_with_permuted_arguments
parent
e444116e
No related branches found
No related tags found
1 merge request
!18
NDArray
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Containers/ndarray/Meta.h
+10
-4
10 additions, 4 deletions
src/TNL/Containers/ndarray/Meta.h
with
10 additions
and
4 deletions
src/TNL/Containers/ndarray/Meta.h
+
10
−
4
View file @
f6d08f4b
...
...
@@ -169,11 +169,11 @@ struct CallPermutationHelper< Permutation, std::index_sequence< N... > >
template
<
typename
Func
,
typename
...
Args
>
__cuda_callable__
static
auto
apply
(
Func
f
,
Args
&&
...
args
)
static
auto
apply
(
Func
&&
f
,
Args
&&
...
args
)
->
decltype
(
auto
)
{
return
f
(
get_from_pack
<
return
std
::
forward
<
Func
>
(
f
)
(
get_from_pack
<
get
<
N
>
(
Permutation
{}
)
>
(
args
...
)...
);
>
(
std
::
forward
<
Args
>
(
args
)
...
)...
);
}
};
...
...
@@ -183,7 +183,13 @@ template< typename Permutation,
typename
Func
,
typename
...
Args
>
__cuda_callable__
auto
call_with_permuted_arguments
(
Func
f
,
Args
&&
...
args
)
// FIXME: does not compile with nvcc 10.0
//auto call_with_permuted_arguments( Func&& f, Args&&... args ) -> decltype(auto)
//{
// return CallPermutationHelper< Permutation, std::make_index_sequence< sizeof...( Args ) > >
// ::apply( std::forward< Func >( f ), std::forward< Args >( args )... );
//}
auto
call_with_permuted_arguments
(
Func
f
,
Args
&&
...
args
)
->
decltype
(
auto
)
{
return
CallPermutationHelper
<
Permutation
,
std
::
make_index_sequence
<
sizeof
...(
Args
)
>
>
::
apply
(
f
,
std
::
forward
<
Args
>
(
args
)...
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment