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

Stokhos: avoid deprecation warnings when compiling with cuda >= 10.0 #10388

Closed
maartenarnst opened this issue Mar 31, 2022 · 2 comments
Closed
Labels
type: enhancement Issue is an enhancement, not a bug

Comments

@maartenarnst
Copy link
Contributor

Enhancement

@trilinos/Stokhos

Many deprecation warnings are issued when compiling Stokhos with cuda >= 10.0. The deprecation warnings come from including math_functions.h in stokhos/src/sacado/kokkos/vector/Sacado_MP_Vector_ops.hpp. The deprecation warnings suggest to include cuda_runtime_api.h instead.

We have implemented the following patch:

From bed0645069b91ea426d7e9711875290162edf399 Mon Sep 17 00:00:00 2001
From: Maarten Arnst <[email protected]>
Date: Fri, 18 Mar 2022 15:42:02 +0100
Subject: [PATCH] Patch avoids many warnings about inclusion of deprecated hpp
 file when compiling with Cuda >= 10.0.

---
 .../src/sacado/kokkos/vector/Sacado_MP_Vector_ops.hpp      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/packages/stokhos/src/sacado/kokkos/vector/Sacado_MP_Vector_ops.hpp b/packages/stokhos/src/sacado/kokkos/vector/Sacado_MP_Vector_ops.hpp
index 7773622bcb2..4f620753d40 100644
--- a/packages/stokhos/src/sacado/kokkos/vector/Sacado_MP_Vector_ops.hpp
+++ b/packages/stokhos/src/sacado/kokkos/vector/Sacado_MP_Vector_ops.hpp
@@ -43,7 +43,12 @@
 #include <ostream>      // for std::ostream

 #ifdef __CUDACC__
-#include <math_functions.h>
+    #include <cuda_runtime_api.h>
+    // including math functions via math_functions.h is deprecated in cuda version >= 10.0
+    // the deprecation warning indicates to use cuda_runtime_api.h instead
+    #if CUDART_VERSION < 10000
+        #include <math_functions.h>
+    #endif
 #endif

 /*
-- 
2.25.1
@etphipp
Copy link
Contributor

etphipp commented Mar 31, 2022

This looks good too. Do you mind submitting a PR?

@maartenarnst
Copy link
Contributor Author

Thanks, @etphipp. I've just submitted a PR. It's #10399.

trilinos-autotester added a commit that referenced this issue Apr 24, 2022
…math

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Stokhos: Fixing #10388
PR Author: maartenarnst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Issue is an enhancement, not a bug
Projects
None yet
Development

No branches or pull requests

2 participants