Skip to content
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

Add missing inline keywords to cudautils::launch #430

Merged

Conversation

fwyzard
Copy link

@fwyzard fwyzard commented Dec 13, 2019

This is part of the proposed changes from #428 .

@fwyzard fwyzard merged commit 17fe590 into cms-patatrack:CMSSW_11_0_X_Patatrack Dec 13, 2019
@fwyzard fwyzard deleted the add_inline_cuda_launch branch December 13, 2019 15:00
@makortel
Copy link

The launch.h is part of cms-sw#28537. @fwyzard, do you agree that I should just cherry-pick the commit there as well (instead of a subsequent PR)?

@fwyzard
Copy link
Author

fwyzard commented Dec 13, 2019

Sure.

@fwyzard
Copy link
Author

fwyzard commented Dec 13, 2019

By the way, clang-format does not seem happy about this file, but I would rather not make the proposed changes:

diff --git a/HeterogeneousCore/CUDAUtilities/interface/launch.h b/HeterogeneousCore/CUDAUtilities/interface/launch.h
index fbf67fbdc59..a72c6a9b6c0 100644
--- a/HeterogeneousCore/CUDAUtilities/interface/launch.h
+++ b/HeterogeneousCore/CUDAUtilities/interface/launch.h
@@ -100,11 +100,11 @@ namespace cudautils {
   template <typename F, typename... Args>
   inline
 #if __cplusplus >= 201703L
-  std::enable_if_t<std::is_invocable_r<void, F, Args&&...>::value>
+      std::enable_if_t<std::is_invocable_r<void, F, Args&&...>::value>
 #else
-  std::enable_if_t<std::is_void<std::result_of_t<F && (Args && ...)> >::value>
+      std::enable_if_t<std::is_void<std::result_of_t<F && (Args && ...)> >::value>
 #endif
-  launch(F* kernel, LaunchParameters config, Args&&... args) {
+      launch(F* kernel, LaunchParameters config, Args&&... args) {
     using function_type = detail::kernel_traits<F>;
     typename function_type::argument_type_tuple args_copy(args...);
 
@@ -126,11 +126,11 @@ namespace cudautils {
   template <typename F, typename... Args>
   inline
 #if __cplusplus >= 201703L
-  std::enable_if_t<std::is_invocable_r<void, F, Args&&...>::value>
+      std::enable_if_t<std::is_invocable_r<void, F, Args&&...>::value>
 #else
-  std::enable_if_t<std::is_void<std::result_of_t<F && (Args && ...)> >::value>
+      std::enable_if_t<std::is_void<std::result_of_t<F && (Args && ...)> >::value>
 #endif
-  launch_cooperative(F* kernel, LaunchParameters config, Args&&... args) {
+      launch_cooperative(F* kernel, LaunchParameters config, Args&&... args) {
     using function_type = detail::kernel_traits<F>;
     typename function_type::argument_type_tuple args_copy(args...);
 

@makortel
Copy link

All that because of the added inline?

@fwyzard
Copy link
Author

fwyzard commented Dec 13, 2019

Yep...

Shall I remove it ?
It should be anyway redundant in a template function (for which we do not use explicit instantiation).

@fwyzard
Copy link
Author

fwyzard commented Dec 13, 2019

Removed it :)

fwyzard pushed a commit that referenced this pull request Mar 24, 2020
Adding c-jet energy regression evaluation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants