Skip to content

Commit

Permalink
Fixes #428: Corrected direction of size check in one of the array cop…
Browse files Browse the repository at this point in the history
…y functions.
  • Loading branch information
eyalroz committed Oct 14, 2022
1 parent 06c32ed commit f17a8f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cuda/api/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ void copy(array_t<T, NumDimensions> destination, array_t<T, NumDimensions> sourc
template <typename T, dimensionality_t NumDimensions>
void copy(region_t destination, const array_t<T, NumDimensions>& source)
{
if (source.size_bytes() < destination.size()) {
if (destination.size() < source.size_bytes()) {
throw ::std::logic_error("Attempt to copy an array into a memory region too small to hold the copy");
}
copy(destination.start(), source);
Expand Down

0 comments on commit f17a8f9

Please sign in to comment.