test(cuda): a changed header compiles the .cu again

CudaCompile's .cu includes a header of its own now. After the unchanged
build, the test makes the header newer than the object and builds once
more, which has to run nvcc again. Before nvcc wrote a depfile, it did
not, and the object built from the old header stayed.
This commit is contained in:
Jorijn van der Graaf 2026-11-11 19:34:52 +01:00
commit 6b2da3b1d6
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
3 changed files with 21 additions and 4 deletions

View file

@ -1,12 +1,13 @@
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
#include "kernel.h"
#include <cstdint>
#include <cuda_runtime.h>
__global__ void Double(float* values, std::int32_t count) {
const std::int32_t i = static_cast<std::int32_t>(blockIdx.x * blockDim.x + threadIdx.x);
if (i < count) values[i] = 2.0f * static_cast<float>(i);
if (i < count) values[i] = Factor * static_cast<float>(i);
}
extern "C" std::int32_t LaunchDouble(std::int32_t count, float* values) {

View file

@ -0,0 +1,8 @@
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
#pragma once
// What kernel.cu multiplies every index by: a header of the .cu's own, which
// the test makes newer than the object built from it.
constexpr float Factor = 2.0f;