Files
composable_kernel/shared_banks/test.cpp
Max Podkorytov 1e2dac15a1 save tmp
2025-11-10 18:27:28 -06:00

20 lines
450 B
C++

#include <hip/hip_runtime.h>
__global__ void conflict_simulator()
{
// __shared__ int buf[64];
// buf[threadIdx.x] = threadIdx.x; // -> 0 conflicts
//
// __shared__ int buf[2 * 64];
// buf[2 * threadIdx.x] = threadIdx.x; // -> 1 conflict per access (2-way)
//
__shared__ int buf[4 * 64];
buf[4 * threadIdx.x] = threadIdx.x; // -> 3 conflicts per access (4-way)
}
int main()
{
conflict_simulator<<<1, 64, 0, 0>>>();
return 0;
}