-
Notifications
You must be signed in to change notification settings - Fork 412
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
Cuda: Fix nvcc warnings #7021
Cuda: Fix nvcc warnings #7021
Changes from all commits
e899550
726a8f2
1876867
d0d99bd
13447c4
5906cba
9d1842e
0e88744
2a15c75
5b0d945
1625ec2
2c3fd02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,7 +186,7 @@ class Cuda { | |
/// | ||
/// This matches the __CUDA_ARCH__ specification. | ||
KOKKOS_DEPRECATED static size_type device_arch() { | ||
const cudaDeviceProp& cudaProp = Cuda().cuda_device_prop(); | ||
const cudaDeviceProp cudaProp = Cuda().cuda_device_prop(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What warning was raised here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dangling reference |
||
return cudaProp.major * 100 + cudaProp.minor; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -21,6 +21,19 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
#include <limits> | ||||||||||||||||||||||||||||||||||||||||||||||||
#include "Kokkos_NumericTraits.hpp" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
// Suppress "'long double' is treated as 'double' in device code" | ||||||||||||||||||||||||||||||||||||||||||||||||
#ifdef KOKKOS_COMPILER_NVCC | ||||||||||||||||||||||||||||||||||||||||||||||||
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ | ||||||||||||||||||||||||||||||||||||||||||||||||
#pragma nv_diagnostic push | ||||||||||||||||||||||||||||||||||||||||||||||||
#pragma nv_diag_suppress 20208 | ||||||||||||||||||||||||||||||||||||||||||||||||
#else | ||||||||||||||||||||||||||||||||||||||||||||||||
#ifdef __CUDA_ARCH__ | ||||||||||||||||||||||||||||||||||||||||||||||||
#pragma diagnostic push | ||||||||||||||||||||||||||||||||||||||||||||||||
#pragma diag_suppress 20208 | ||||||||||||||||||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+24
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel that is not the right approach for that test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could just disable all tests for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, everything that uses kokkos/core/unit_test/TestNumericTraits.hpp Lines 182 to 204 in 63f0520
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
struct extrema { | ||||||||||||||||||||||||||||||||||||||||||||||||
#define DEFINE_EXTREMA(T, m, M) \ | ||||||||||||||||||||||||||||||||||||||||||||||||
KOKKOS_FUNCTION static T min(T) { return m; } \ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -736,3 +749,13 @@ CHECK_NAN_INSTANTIATED_ON_CV_QUALIFIED_TYPES_FLOATING_POINT(signaling_NaN); | |||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
#undef CHECK_NAN_INSTANTIATED_ON_CV_QUALIFIED_TYPES_FLOATING_POINT | ||||||||||||||||||||||||||||||||||||||||||||||||
#undef CHECK_NAN_INSTANTIATED_ON_CV_QUALIFIED_TYPES | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
#ifdef KOKKOS_COMPILER_NVCC | ||||||||||||||||||||||||||||||||||||||||||||||||
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ | ||||||||||||||||||||||||||||||||||||||||||||||||
#pragma nv_diagnostic pop | ||||||||||||||||||||||||||||||||||||||||||||||||
#else | ||||||||||||||||||||||||||||||||||||||||||||||||
#ifdef __CUDA_ARCH__ | ||||||||||||||||||||||||||||||||||||||||||||||||
#pragma diagnostic pop | ||||||||||||||||||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||||||||||||||||||||||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4910,7 +4910,7 @@ class NeverThrown { | |
class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \ | ||
: public parent_class { \ | ||
public: \ | ||
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() = default; \ | ||
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() { (void)test_info_; }\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please reference issues or rejected prs on googletest that show that there is no interest on resolving this upstream? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. google/googletest#4104 (comment) mentions that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be a problem if we later want to update gtest ? What do you think of pre-installing all Kokkos dependencies in the CI so that we use the flags we want solely on Kokkos ? We could then compile gtest with the host compiler ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We will notice if this is still a problem or not.
This is not about installing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I had in mind that using an installed gtest would treat gtest include header path as system path thus removing the warnings ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could try that (in a separate pull request); it's certainly a bigger change than changing this one line. |
||
~GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() override = default; \ | ||
GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \ | ||
test_name)); \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to move pragma push into the
Complex.hpp
to avoid seeing the warning. At this point, it seems to be better to just disable the warning for this build in the compiler flags.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
all_warnings
accompany the second-Werror
? I'm really asking for clarification on why-Werror
is needed twice.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-Werror
is for the host compiler and-Werror all-warnings
is for the device compiler.