From a512a48dbccfe928bcc9567f87ed7238354c5489 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 18 Sep 2024 13:52:56 -0700 Subject: [PATCH 1/5] Move c/include/cccl/*.h files to c/include/cccl/c/*.h --- c/include/cccl/{ => c}/reduce.h | 2 +- c/include/cccl/{ => c}/types.h | 0 c/src/reduce.cu | 2 +- c/test/c2h.h | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename c/include/cccl/{ => c}/reduce.h (98%) rename c/include/cccl/{ => c}/types.h (100%) diff --git a/c/include/cccl/reduce.h b/c/include/cccl/c/reduce.h similarity index 98% rename from c/include/cccl/reduce.h rename to c/include/cccl/c/reduce.h index 5047625a85..a42abce040 100644 --- a/c/include/cccl/reduce.h +++ b/c/include/cccl/c/reduce.h @@ -16,7 +16,7 @@ # include -# include +# include struct cccl_device_reduce_build_result_t { diff --git a/c/include/cccl/types.h b/c/include/cccl/c/types.h similarity index 100% rename from c/include/cccl/types.h rename to c/include/cccl/c/types.h diff --git a/c/src/reduce.cu b/c/src/reduce.cu index 4badcd1ff0..fc88dd31a9 100644 --- a/c/src/reduce.cu +++ b/c/src/reduce.cu @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/c/test/c2h.h b/c/test/c2h.h index e2b26895a8..e044d2e17a 100644 --- a/c/test/c2h.h +++ b/c/test/c2h.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include static std::string inspect_sass(const void* cubin, size_t cubin_size) From d9629d954aad4ac4915a13681613263a38bc2c27 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 18 Sep 2024 13:59:01 -0700 Subject: [PATCH 2/5] Change `#warning` to `#error` (to improve the user experience). --- c/include/cccl/c/reduce.h | 10 ++++------ c/include/cccl/c/types.h | 16 +++++++--------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/c/include/cccl/c/reduce.h b/c/include/cccl/c/reduce.h index a42abce040..32047ee8bd 100644 --- a/c/include/cccl/c/reduce.h +++ b/c/include/cccl/c/reduce.h @@ -11,12 +11,12 @@ #pragma once #ifndef CCCL_C_EXPERIMENTAL -# warning "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this warning." -#else // ^^^ !CCCL_C_EXPERIMENTAL ^^^ / vvv CCCL_C_EXPERIMENTAL vvv +# error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice." +#endif -# include +#include -# include +#include struct cccl_device_reduce_build_result_t { @@ -55,5 +55,3 @@ extern "C" CCCL_C_API CUresult cccl_device_reduce( CUstream stream) noexcept; extern "C" CCCL_C_API CUresult cccl_device_reduce_cleanup(cccl_device_reduce_build_result_t* bld_ptr); - -#endif // CCCL_C_EXPERIMENTAL diff --git a/c/include/cccl/c/types.h b/c/include/cccl/c/types.h index 781b9f9ea6..3f9f8d61bf 100644 --- a/c/include/cccl/c/types.h +++ b/c/include/cccl/c/types.h @@ -11,14 +11,14 @@ #pragma once #ifndef CCCL_C_EXPERIMENTAL -# warning "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this warning." -#else // ^^^ !CCCL_C_EXPERIMENTAL ^^^ / vvv CCCL_C_EXPERIMENTAL vvv +# error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice." +#endif -# if defined(_WIN32) -# define CCCL_C_API __declspec(dllexport) -# else -# define CCCL_C_API __attribute__((visibility("default"))) -# endif +#if defined(_WIN32) +# define CCCL_C_API __declspec(dllexport) +#else +# define CCCL_C_API __attribute__((visibility("default"))) +#endif enum class cccl_type_enum { @@ -81,5 +81,3 @@ struct cccl_iterator_t cccl_type_info value_type; void* state; }; - -#endif // CCCL_C_EXPERIMENTAL From 9211440e797e306f1eb475468b65bb88bbf0c455 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 19 Sep 2024 08:43:01 -0700 Subject: [PATCH 3/5] Add comments to preprocessor conditionals. Co-authored-by: Michael Schellenberger Costa --- c/include/cccl/c/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/include/cccl/c/types.h b/c/include/cccl/c/types.h index 3f9f8d61bf..e2eadc0225 100644 --- a/c/include/cccl/c/types.h +++ b/c/include/cccl/c/types.h @@ -12,7 +12,7 @@ #ifndef CCCL_C_EXPERIMENTAL # error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice." -#endif +#endif // !CCCL_C_EXPERIMENTAL #if defined(_WIN32) # define CCCL_C_API __declspec(dllexport) From e21b58c27826c8b6a6404c64e039b1d3a33b6034 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 19 Sep 2024 08:43:11 -0700 Subject: [PATCH 4/5] Add comments to preprocessor conditionals. Co-authored-by: Michael Schellenberger Costa --- c/include/cccl/c/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/include/cccl/c/types.h b/c/include/cccl/c/types.h index e2eadc0225..f34466c755 100644 --- a/c/include/cccl/c/types.h +++ b/c/include/cccl/c/types.h @@ -16,9 +16,9 @@ #if defined(_WIN32) # define CCCL_C_API __declspec(dllexport) -#else +#else // ^^^ _WIN32 ^^^ / vvv !_WIN32 vvv # define CCCL_C_API __attribute__((visibility("default"))) -#endif +#endif // !_WIN32 enum class cccl_type_enum { From 9cd240227c15a217072f04f4fcc326d1c032d552 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 19 Sep 2024 08:48:35 -0700 Subject: [PATCH 5/5] Add comment to preprocessor conditional. --- c/include/cccl/c/reduce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/include/cccl/c/reduce.h b/c/include/cccl/c/reduce.h index 32047ee8bd..1da7b51f01 100644 --- a/c/include/cccl/c/reduce.h +++ b/c/include/cccl/c/reduce.h @@ -12,7 +12,7 @@ #ifndef CCCL_C_EXPERIMENTAL # error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice." -#endif +#endif // !CCCL_C_EXPERIMENTAL #include