NVIDIA / NVIDIA/cccl

[STF] Ensure occupancy computation are properly cached

Open
#5,291 0 comments 0 reactions 2 assignees Claimed by @andralex View on GitHub
stf
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Is this a duplicate?

- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this bug and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Type of Bug

Runtime Error

### Component

CUDA Experimental (cudax)

### Describe the bug

This is a extension of discussions in #5236 : we currently cache occupancy computations according to the Function type passed to the occupancy calculator utility. This is ok when we have lambda functions which are uniquely associated to the type, but this could be inappropriate when passing different functions which may have the same prototype.

Assuming the occupancy computation is not cost-less, we could move the occupancy cache to a separate object which is only used when appropriate (eg. in parallel_for_scope)

At the moment, this is probably not a problem in practice, but we are already using occupancy helpers in examples where we do not use a lambda function.

### How to Reproduce

Any STF application using the occupancy computation utility, or parallel_for constructs

### Expected behavior

We should ensure that cached occupancy information is not corrupted when we use the utility with different functions that have the same prototype.

### Reproduction link

_No response_

### Operating System

_No response_

### nvidia-smi output

_No response_

### NVCC version

_No response_

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.