Skip to content

Commit

Permalink
Comment tweaks in event.hpp and launch_config_builder.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalroz authored and Eyal Rozenberg committed Mar 9, 2023
1 parent 2fbfb85 commit 30fa9af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/cuda/api/event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ inline void wait(const event_t& event);
* an event on construction and destroy it on destruction, and isn't merely
* an ephemeral wrapper one could apply and discard; but this second kind of
* semantics is also (sort of) supported, through the @ref event_t::owning field.
*
* @note this is one of the three main classes in the Runtime API wrapper library,
* together with @ref cuda::device_t and @ref cuda::stream_t
* @note This class is a "reference type", not a "value type". Therefore, making changes
* to the event is a const-respecting operation on this class.
*/
class event_t {

Expand Down Expand Up @@ -254,9 +249,9 @@ class event_t {
public: // constructors and destructor

// Events cannot be copied, despite our allowing non-owning class instances.
// The reason is that we might inadvertently copy of an owning stream, creating
// a non-owning stream and letting the original owning stream go out of scope -
// thus destructing the object, and destroying the underlying CUDA object.
// The reason is that we might inadvertently copy an owning instance, creating
// a non-owning instance and letting the original owning instance go out of scope -
// thus destructing the C++ object, and destroying the underlying CUDA object.
// Essentially, that is like passing a reference to a local variable - which we
// may not do.
event_t(const event_t& other) = delete;
Expand Down
3 changes: 2 additions & 1 deletion src/cuda/api/launch_config_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class launch_config_builder_t {
"Neither block nor grid dimensions have been specified");
} else if (not dimensions_.block and not dimensions_.overall) {
throw ::std::logic_error(
"Grid dimensions only been specified in terms of blocks, not threads, and no block dimensions specified");
"Attempt to obtain the composite grid dimensions, while the grid dimensions have only bee specified "
"in terms of blocks, not threads, with no block dimensions specified");
} else { // it must be the case that (not dimensions_.block and not dimensions_.overall)
throw ::std::logic_error(
"Only block dimensions have been specified - cannot resolve launch grid dimensions");
Expand Down

0 comments on commit 30fa9af

Please sign in to comment.