Skip to content

Commit

Permalink
Add -Wmissing-field-initializers to cudax (#2373)
Browse files Browse the repository at this point in the history
Change cudaLaunchConfig_t init to {}

Co-authored-by: Michael Schellenberger Costa <[email protected]>
  • Loading branch information
pciolkosz and miscco committed Sep 5, 2024
1 parent 3876dcc commit af695d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cudax/cmake/cudaxBuildCompilerTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ function(cudax_build_compiler_targets)

# GCC 7.3 complains about name mangling changes due to `noexcept`
append_option_if_available("-Wno-noexcept-type" cxx_compile_options)

append_option_if_available("-Wmissing-field-initializers" cxx_compile_options)
endif()

if ("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
Expand Down
2 changes: 1 addition & 1 deletion cudax/include/cuda/experimental/__launch/launch.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ template <typename Config, typename Kernel, typename... Args>
_CCCL_NODISCARD cudaError_t
launch_impl(::cuda::stream_ref stream, Config conf, const Kernel& kernel_fn, const Args&... args)
{
cudaLaunchConfig_t config = {0};
cudaLaunchConfig_t config{};
cudaError_t status = cudaSuccess;
constexpr bool has_cluster_level = has_level<cluster_level, decltype(conf.dims)>;
constexpr unsigned int num_attrs_needed = detail::kernel_config_count_attr_space(conf) + has_cluster_level;
Expand Down
2 changes: 1 addition & 1 deletion cudax/test/launch/configuration.cu
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ auto configuration_test(
::cuda::stream_ref stream, const dim3& grid_dims, const dim3& block_dims, const dim3& cluster_dims = dim3())
{
auto dims = make_test_dims<HasCluster>(grid_dims, block_dims, cluster_dims);
expectedConfig = {0};
expectedConfig = {};
expectedConfig.stream = stream.get();
if constexpr (HasCluster)
{
Expand Down

0 comments on commit af695d0

Please sign in to comment.