From 8586e50b61697a2d202ccc8a18ea1b1ec487bf21 Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Mon, 23 Dec 2024 02:25:27 +0200 Subject: [PATCH] Fixes #702: Removed gratuitous space for the `--no-source-include` NVRTC compilation option --- doxygen.cfg | 9 ++++++++- .../api/multi_wrapper_impls/kernel_launch.hpp | 15 +++++++++++++++ .../multi_wrapper_impls/launch_configuration.hpp | 1 + src/cuda/rtc/compilation_options.hpp | 2 +- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/doxygen.cfg b/doxygen.cfg index 1c8fcbe7..22518678 100644 --- a/doxygen.cfg +++ b/doxygen.cfg @@ -1,4 +1,4 @@ -# Doxyfile 1.10.0 +# Doxyfile # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -592,6 +592,13 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO +# If the HIDE_UNDOC_NAMESPACES tag is set to \c YES, Doxygen will hide all +# undocumented namespaces that are normally visible in the namespace hierarchy. +# If set to NO, these namespaces will be included in the various overviews. +# This option has no effect if \ref cfg_extract_all "EXTRACT_ALL" is enabled. + +HIDE_UNDOC_NAMESPACES = NO + # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # declarations. If set to NO, these declarations will be included in the # documentation. diff --git a/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp b/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp index e207bb0c..b03f9aa1 100644 --- a/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp +++ b/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp @@ -191,6 +191,21 @@ inline void validate_block_dimension_compatibility( } } +inline void validate_dyanmic_shared_memory_size( + const kernel_t& kernel, + memory::shared::size_t dynamic_shared_memory_size) +{ + memory::shared::size_t max_dyn_shmem = kernel.get_attribute( + kernel::attribute_t::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES); + if (dynamic_shared_memory_size > max_dyn_shmem) { + throw ::std::invalid_argument( + "specified size of dynamic shared memory, " + ::std::to_string(dynamic_shared_memory_size) + + "bytes, exceeds the maximum supported by " + kernel::detail_::identify(kernel) + + ", " + ::std::to_string(max_dyn_shmem) + " bytes"); + } +} + + template void enqueue_launch_helper::operator()( const kernel::apriori_compiled_t& wrapped_kernel, diff --git a/src/cuda/api/multi_wrapper_impls/launch_configuration.hpp b/src/cuda/api/multi_wrapper_impls/launch_configuration.hpp index d25e26e5..804487a2 100644 --- a/src/cuda/api/multi_wrapper_impls/launch_configuration.hpp +++ b/src/cuda/api/multi_wrapper_impls/launch_configuration.hpp @@ -23,6 +23,7 @@ inline void validate_compatibility( { validate(launch_config); validate_block_dimension_compatibility(kernel, launch_config.dimensions.block); + validate_dyanmic_shared_memory_size(kernel, launch_config.dynamic_shared_memory_size); // Uncomment if we actually get such checks // validate_grid_dimension_compatibility(kernel, launch_config.dimensions.grid); validate_compatibility(kernel.device(), launch_config); diff --git a/src/cuda/rtc/compilation_options.hpp b/src/cuda/rtc/compilation_options.hpp index 7e4ecc12..e702992b 100644 --- a/src/cuda/rtc/compilation_options.hpp +++ b/src/cuda/rtc/compilation_options.hpp @@ -666,7 +666,7 @@ struct gadget, MarshalTarget, Delimiter> { if (opts.syntax_check_only) { marshalled << opt_start << "--fdevice-syntax-only"; } if (opts.less_builtins) { marshalled << opt_start << "--minimal"; } if (not opts.builtin_initializer_list) { marshalled << opt_start << "--builtin-initializer-list=false"; } - if (not opts.source_dirs_in_include_path) { marshalled << opt_start << "--no-source-include "; } + if (not opts.source_dirs_in_include_path) { marshalled << opt_start << "--no-source-include"; } if (opts.extra_device_vectorization) { marshalled << opt_start << "--extra-device-vectorization"; } if (opts.disable_warnings) { marshalled << opt_start << "--disable-warnings"; } if (opts.assume_restrict) { marshalled << opt_start << "--restrict"; }