MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / initParticles

Function initParticles

cpp/5_Domain_Specific/fluidsGL/fluidsGL.cpp:248–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void initParticles(cData *p, int dx, int dy)
249{
250 int i, j;
251
252 for (i = 0; i < dy; i++) {
253 for (j = 0; j < dx; j++) {
254 p[i * dx + j].x = (j + 0.5f + (myrand() - 0.5f)) / dx;
255 p[i * dx + j].y = (i + 0.5f + (myrand() - 0.5f)) / dy;
256 }
257 }
258}
259
260void keyboard(unsigned char key, int x, int y)
261{

Callers 2

keyboardFunction · 0.70
mainFunction · 0.70

Calls 1

myrandFunction · 0.70

Tested by

no test coverage detected