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

Method getArray

cpp/2_Concepts_and_Techniques/particles/particleSystem.cpp:351–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351float *ParticleSystem::getArray(ParticleArray array)
352{
353 assert(m_bInitialized);
354
355 float *hdata = 0;
356 float *ddata = 0;
357 struct cudaGraphicsResource *cuda_vbo_resource = 0;
358
359 switch (array) {
360 default:
361 case POSITION:
362 hdata = m_hPos;
363 ddata = m_dPos;
364 cuda_vbo_resource = m_cuda_posvbo_resource;
365 break;
366
367 case VELOCITY:
368 hdata = m_hVel;
369 ddata = m_dVel;
370 break;
371 }
372
373 copyArrayFromDevice(hdata, ddata, &cuda_vbo_resource, m_numParticles * 4 * sizeof(float));
374 return hdata;
375}
376
377void ParticleSystem::setArray(ParticleArray array, const float *data, int start, int count)
378{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected