First reported here: NVIDIA/cccl#3103
sccache is incorrectly yielding cache hits on code guarded by #ifndef __CUDA_ARCH__, e.g.:
#ifndef __CUDA_ARCH__
const auto x = "host-only code";
#endif
If the code inside the #ifndef changes, sccache yields a cache hit when it should've been a cache miss, because nvcc -E injects -D__CUDA_ARCH__ (and likely others like -D__CUDA_ARCH_LIST__) into the host preprocessor invocations.
This bug has existed from before I rewrote how sccache handles nvcc compilations.
Luckily, we can fix this because I rewrote how sccache handles nvcc compilations 🙂.
First reported here: NVIDIA/cccl#3103
sccache is incorrectly yielding cache hits on code guarded by
#ifndef __CUDA_ARCH__, e.g.:If the code inside the
#ifndefchanges, sccache yields a cache hit when it should've been a cache miss, becausenvcc -Einjects-D__CUDA_ARCH__(and likely others like-D__CUDA_ARCH_LIST__) into the host preprocessor invocations.This bug has existed from before I rewrote how sccache handles nvcc compilations.
Luckily, we can fix this because I rewrote how sccache handles nvcc compilations 🙂.