Skip to content

Commit

Permalink
Merge pull request #53 from fwyzard/fix_signed_vs_unsiged_comparisons
Browse files Browse the repository at this point in the history
Fix signed vs unsigned comparisons
  • Loading branch information
AlexVlx committed Feb 16, 2024
2 parents 4ebc36f + e49225b commit 3fef321
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/include/hip/detail/intrinsics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace hip

Tile::this_tile().barrier();

const auto sidx{(tidx / w * w) + src};
const auto sidx{static_cast<std::int32_t>((tidx / w * w) + src)};
const auto r{
(src < 0 || sidx >= w) ? x : Tile::scratchpad<T>()[sidx]};

Expand All @@ -233,7 +233,7 @@ namespace hip

Tile::this_tile().barrier();

const auto sidx{(tidx / w * w) + (tidx % w) + dx};
const auto sidx{static_cast<std::int32_t>((tidx / w * w) + (tidx % w) + dx)};
const auto r{
(sidx < 0 || sidx >= w) ? x : Tile::scratchpad<T>()[sidx]};

Expand All @@ -253,7 +253,7 @@ namespace hip

Tile::this_tile().barrier();

const auto sidx{(tidx / w * w) + (tidx % w) - dx};
const auto sidx{static_cast<std::int32_t>((tidx / w * w) + (tidx % w) - dx)};
const auto r{
(sidx < 0 || sidx >= w) ? x : Tile::scratchpad<T>()[sidx]};

Expand All @@ -273,7 +273,7 @@ namespace hip

Tile::this_tile().barrier();

const auto sidx{((tidx / w * w) + (tidx % w)) ^ src};
const auto sidx{static_cast<std::int32_t>(((tidx / w * w) + (tidx % w)) ^ src)};
const auto r{(src < 0) ? x : Tile::scratchpad<T>()[sidx]};

Tile::this_tile().barrier();
Expand Down Expand Up @@ -304,4 +304,4 @@ namespace hip
return thread_fence();
}
} // Namespace hip::detail;
} // Namespace hip.
} // Namespace hip.

0 comments on commit 3fef321

Please sign in to comment.