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

In-place guarantees for scan algorithms #490

Merged
merged 1 commit into from
May 24, 2022

Conversation

gevtushenko
Copy link
Collaborator

This PR addresses multiple issues of in-place execution for scan algorithms:

Scan:

  • LOAD_LDG is removed from tuning policies to guarantee in-place execution. Affected architectures are Kepler and Maxwell. Benchmarks showed no difference in performance on those platforms.
  • In-place execution guarantees are highlighted in the documentation of the existing API
  • In-place API is provided
  • In-place tests are fixed. The code used to compare decltype(*d_in) with OutputT which always led to comparing T& with T. Therefore, we've never tested in-place execution.

Scan by key:

  • LOAD_LDG is removed from tuning policies to guarantee in-place execution.
  • To preserve thrust documentation guarantees, implementation is changed to allow aliasing of keys/results. This change affects performance on small to moderate problem sizes (up to 6% slowdown).
  • In-place execution guarantees are highlighted in the documentation of the existing API
  • Tests of in/out values aliasing are fixed. The code used to compare decltype(*d_values_in) with OutputT which always led to comparing T& with T. Therefore, we've never tested in-place execution.
  • Tests of keys/values aliasing are added.

gevtushenko added a commit to gevtushenko/thrust that referenced this pull request May 23, 2022
@gevtushenko gevtushenko force-pushed the enh-main/github/in_place_scan branch from 3223c16 to b00f714 Compare May 23, 2022 11:48
gevtushenko added a commit to gevtushenko/thrust that referenced this pull request May 23, 2022
@gevtushenko gevtushenko force-pushed the enh-main/github/in_place_scan branch from b00f714 to b99db91 Compare May 23, 2022 13:20
gevtushenko added a commit to gevtushenko/thrust that referenced this pull request May 23, 2022
@gevtushenko gevtushenko added the testing: gpuCI passed Passed gpuCI testing. label May 23, 2022
@alliepiper alliepiper added this to the 2.0.0 milestone May 24, 2022
Copy link
Collaborator

@alliepiper alliepiper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor issues in doc strings, but otherwise LGTM.

cub/device/device_scan.cuh Outdated Show resolved Hide resolved
cub/device/device_scan.cuh Outdated Show resolved Hide resolved
@gevtushenko gevtushenko force-pushed the enh-main/github/in_place_scan branch from b99db91 to 6751982 Compare May 24, 2022 18:54
@gevtushenko gevtushenko merged commit 7a9a501 into NVIDIA:main May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testing: gpuCI passed Passed gpuCI testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants