Skip to content

Commit

Permalink
Merge branch 'fix-RLE-for-nan' into 'develop_stream'
Browse files Browse the repository at this point in the history
Fix reduce_by_key algorithm so keys[0] is not flagged as a new run when is nan

See merge request amd/libraries/rocPRIM!547
  • Loading branch information
Beanavil authored and Naraenda committed Oct 18, 2023
2 parents 46e0296 + be98ebf commit 759a6f4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -384,7 +384,9 @@ class tile_helper
= segment_heads_in_block - (is_global_first_tile ? 1 : 0)
+ (is_global_last_tile && valid_in_global_last_tile != items_per_tile ? 1 : 0);

if(is_global_first_tile && flat_thread_id == 0)
// Reset head-flag on the very first item to make sure we don't start a new run for data where
// (key[0] == key[0]) is false (e.g., when key[0] is NaN).
if(is_first_tile && flat_thread_id == 0)
{
head_flags[0] = 0;
}
Expand Down

0 comments on commit 759a6f4

Please sign in to comment.