Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Fix temp storage allocation in adj diff copy
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed Jul 18, 2022
1 parent c64885b commit ce8d531
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions cub/device/dispatch/dispatch_adjacent_difference.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -199,30 +199,27 @@ struct DispatchAdjacentDifference : public SelectedPolicy
sizeof(InputT);

void *allocations[1] = {nullptr};
std::size_t allocation_sizes[1] = {first_tile_previous_size};
std::size_t allocation_sizes[1] = {MayAlias * first_tile_previous_size};

if (MayAlias)
if (CubDebug(error = AliasTemporaries(d_temp_storage,
temp_storage_bytes,
allocations,
allocation_sizes)))
{
if (CubDebug(error = AliasTemporaries(d_temp_storage,
temp_storage_bytes,
allocations,
allocation_sizes)))
{
break;
}

if (d_temp_storage == nullptr)
{
// Return if the caller is simply requesting the size of the storage
// allocation
break;
}

if (temp_storage_bytes == 0)
{
temp_storage_bytes = 1;
}
if (d_temp_storage == nullptr)
{
// Return if the caller is simply requesting the size of the storage
// allocation

break;
if (temp_storage_bytes == 0)
{
temp_storage_bytes = 1;
}

break;
}

if (num_items == OffsetT{})
Expand Down

0 comments on commit ce8d531

Please sign in to comment.