NVIDIA / NVIDIA/cccl

apply_access_property implementation doubt

Open
#1,126 0 comments 0 reactions 1 assignee Claimed by @wmaxey View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Discussed in https://github.com/NVIDIA/cccl/discussions/1125

Originally posted by **sicario001** November 19, 2023
The following [code snippet](https://github.com/NVIDIA/cccl/blob/61c328aee025a43045ed2f971ec3ec3fbd6bf695/libcudacxx/include/cuda/annotated_ptr#L150C1-L152C1) is part of the apply_access_property implementation. My concern is that doesn't this apply the evict_last property to addresses in multiples of **_LINE_SIZE*_LINE_SIZE = 128*128**? Shouldn't we actually do this in multiples of **_LINE_SIZE**? That would require replacing `__i += _LINE_SIZE` with `__i += 1`.
Please correct me if I am wrong if I am missing something.
Thanks

```
for (std::size_t __i = 0; __i < __end; __i += _LINE_SIZE) {
asm volatile ("prefetch.global.L2::evict_last [%0];" ::"l"(__p + (__i * _LINE_SIZE)) :);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.