chore(repo): initialize reproducible research workspace

This commit is contained in:
Jinotech
2026-09-20 05:17:11 +12:00
commit 1e7cc2a71b
36 changed files with 9169 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#include <cuda_runtime.h>
#include <cstdio>
__global__ void increment(int* value) {
*value += 1;
}
int main() {
int host_value = 41;
int* device_value = nullptr;
if (cudaMalloc(&device_value, sizeof(int)) != cudaSuccess) {
return 1;
}
if (cudaMemcpy(device_value, &host_value, sizeof(int), cudaMemcpyHostToDevice) != cudaSuccess) {
cudaFree(device_value);
return 2;
}
increment<<<1, 1>>>(device_value);
if (cudaDeviceSynchronize() != cudaSuccess) {
cudaFree(device_value);
return 3;
}
if (cudaMemcpy(&host_value, device_value, sizeof(int), cudaMemcpyDeviceToHost) != cudaSuccess) {
cudaFree(device_value);
return 4;
}
cudaFree(device_value);
std::printf("cuda_smoke_result=%d\n", host_value);
return host_value == 42 ? 0 : 5;
}