HIP
1 program
Added 2026-03-05T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: Heterogeneous-Computing Interface for Portability, HIP C++
Provenance: commit b8c2ccb35c · authored 2026-03-05T01:00:21+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
2 sources · pl_id:
pl/hipExtensions claimed by this language
1 claim. Each row is one upstream assertion with its strength.
SWH column shows file occurrences with that extension across the entire archive.| Extension | Source | Strength | SWH |
|---|---|---|---|
.hip | linguist | primary | 53.2K files |
Related languages
LLM-contributed programs
Vector Addition
Provenance: commit b8c2ccb35c · authored 2026-03-05T01:00:21+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
#include <hip/hip_runtime.h>
#include <stdio.h>
#define THREADS_PER_BLOCK 256
#define N 1048576
__global__ void vectorAdd(const float *a, const float *b, float *c, int n) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx < n) {
c[idx] = a[idx] + b[idx];
}
}
int main() {
float *h_a, *h_b, *h_c;
float *d_a, *d_b, *d_c;
size_t size = N * sizeof(float);
h_a = (float *)malloc(size);
h_b = (float *)malloc(size);
h_c = (float *)malloc(size);
for (int i = 0; i < N; i++) {
h_a[i] = (float)i;
h_b[i] = (float)(N - i);
}
hipMalloc((void **)&d_a, size);
hipMalloc((void **)&d_b, size);
hipMalloc((void **)&d_c, size);
hipMemcpy(d_a, h_a, size, hipMemcpyHostToDevice);
hipMemcpy(d_b, h_b, size, hipMemcpyHostToDevice);
int blocks = (N + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;
hipLaunchKernelGGL(vectorAdd, dim3(blocks), dim3(THREADS_PER_BLOCK), 0, 0,
d_a, d_b, d_c, N);
hipMemcpy(h_c, d_c, size, hipMemcpyDeviceToHost);
printf("h_c[0] = %f\n", h_c[0]);
printf("h_c[%d] = %f\n", N - 1, h_c[N - 1]);
hipFree(d_a);
hipFree(d_b);
hipFree(d_c);
free(h_a);
free(h_b);
free(h_c);
return 0;
}
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)