Skip to content

sccache incorrectly yields hits for code guarded by #ifndef __CUDA_ARCH__ #2299

@trxcllnt

Description

@trxcllnt

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 🙂.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions