Skip to content

Commit

Permalink
avoid gcc optimizer bug by not force inlining part of `thrust::transf…
Browse files Browse the repository at this point in the history
…orm` (#2509)
  • Loading branch information
ericniebler authored Oct 4, 2024
1 parent e8d57c3 commit 583567b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions thrust/thrust/system/cuda/detail/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ struct binary_transform_f<InputIt1, InputIt2, OutputIt, no_stencil_tag, Transfor
}
}; // struct binary_transform_f

// EAN 2024-10-04: when force-inlined, gcc's optimizer will generate bad code
// for this function:
template <class Policy, class InputIt, class Size, class OutputIt, class StencilIt, class TransformOp, class Predicate>
OutputIt THRUST_FUNCTION unary(
OutputIt _CCCL_HOST_DEVICE inline unary(
Policy& policy,
InputIt items,
OutputIt result,
Expand All @@ -200,6 +202,8 @@ OutputIt THRUST_FUNCTION unary(
return result + num_items;
}

// EAN 2024-10-04: when force-inlined, gcc's optimizer will generate bad code
// for this function:
template <class Policy,
class InputIt1,
class InputIt2,
Expand All @@ -208,7 +212,7 @@ template <class Policy,
class StencilIt,
class TransformOp,
class Predicate>
OutputIt THRUST_FUNCTION binary(
OutputIt _CCCL_HOST_DEVICE inline binary(
Policy& policy,
InputIt1 items1,
InputIt2 items2,
Expand Down

0 comments on commit 583567b

Please sign in to comment.