Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes discard_memory compilation failure for pre-Volta #637

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

elstehle
Copy link
Collaborator

Description

Closes issue #624 and unblocks PR #619

Including <cuda/annotated_ptr> includes <cuda/barrier>, which in turn includs "std/barrier". "std/barrier" in turn has the following guard in place:

#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 700
#  error "CUDA synchronization primitives are only supported for sm_70 and up."
#endif

This prevents users from using functionality like cuda::discard_memory in <cuda/annotated_ptr> that does not rely on barrier.

This PR:

  • moves cuda::discard_memory to its own header
  • fixes aligned pointer computation in cuda::discard_memory and the loop for discarding memory
  • fixes initialization order in __access_property that the compiler complained about

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@elstehle elstehle requested review from a team as code owners October 31, 2023 11:20
@elstehle elstehle requested review from miscco and wmaxey and removed request for a team October 31, 2023 11:20
@elstehle elstehle changed the title Fix/discard memory war Fixes discard_memory compilation failure for pre-Volta Oct 31, 2023
libcudacxx/include/cuda/discard_memory Outdated Show resolved Hide resolved
libcudacxx/include/cuda/discard_memory Outdated Show resolved Hide resolved
@jrhemstad jrhemstad merged commit 11173c8 into NVIDIA:main Nov 6, 2023
514 of 517 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants