make shared ptrs device ptrs

This commit is contained in:
2026-07-17 16:45:52 -07:00
parent c0a0d101eb
commit f2c7c0d882
+6 -6
View File
@@ -30,9 +30,9 @@ struct Polyparti::ParticleField::ColCode {
//Pointers to malloc on GPU VRAM for calculations. malloc_shared pointers are entry/exit //Pointers to malloc on GPU VRAM for calculations. malloc_shared pointers are entry/exit
//point for data in CPU RAM //point for data in CPU RAM
float *v_ptr = malloc_shared<float>(2 * len_points, q); float *v_ptr = malloc_device<float>(2 * len_points, q);
float *d_ptr = malloc_shared<float>(2 * len_points, q); float *d_ptr = malloc_device<float>(2 * len_points, q);
float *c_ptr = malloc_shared<float>(2 * len_points, q); float *c_ptr = malloc_device<float>(2 * len_points, q);
float *ray_ptr = malloc_device<float>(2 * len_points, q); float *ray_ptr = malloc_device<float>(2 * len_points, q);
float *det_ptr = malloc_device<float>(len_points, q); float *det_ptr = malloc_device<float>(len_points, q);
float *bestA_ptr = malloc_device<float>(2 * len_points, q); float *bestA_ptr = malloc_device<float>(2 * len_points, q);
@@ -170,9 +170,9 @@ struct Polyparti::ParticleField::ColCode {
void moveParticles() { void moveParticles() {
queue& q = q_shared(); queue& q = q_shared();
int len = positions.size(); int len = positions.size();
float *v_ptr = malloc_shared<float>(2 * len, q); float *v_ptr = malloc_device<float>(2 * len, q);
float *p_ptr = malloc_shared<float>(2 * len, q); float *p_ptr = malloc_device<float>(2 * len, q);
float *t_ptr = malloc_shared<float>(1, q); float *t_ptr = malloc_device<float>(1, q);
q.submit([&](handler& h) { q.submit([&](handler& h) {
h.memcpy(p_ptr, &positions[0], len * 2 * sizeof(float)); h.memcpy(p_ptr, &positions[0], len * 2 * sizeof(float));