Skip to content

Commit

Permalink
Fixes #330: Ensuring either a kernel or a device have been associated…
Browse files Browse the repository at this point in the history
… when trying to `use_maximum_linear_block()` in a launch config builder.
  • Loading branch information
eyalroz committed May 24, 2022
1 parent 1f36c11 commit 543e9ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cuda/api/launch_config_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ class launch_config_builder_t {
else if (device_) {
max_size = device().maximum_threads_per_block();
}
else {
throw std::logic_error("Request to use the maximum-size linear block, with no device or kernel specified");
}
auto block_dims = grid::block_dimensions_t { max_size, 1, 1 };

if (dimensions_.grid and dimensions_.overall) {
Expand Down

0 comments on commit 543e9ec

Please sign in to comment.