Bug 5812203: Replace thrust::make_tuple,tuple,get with the cuda::std ones

This commit is contained in:
Shawn Zeng
2026-01-16 17:56:50 +08:00
parent af49216f0c
commit 6c4d183ba3
6 changed files with 43 additions and 38 deletions

View File

@@ -135,8 +135,8 @@ extern "C"
thrust::device_ptr<float4> d_pos4((float4 *)pos);
thrust::device_ptr<float4> d_vel4((float4 *)vel);
thrust::for_each(thrust::make_zip_iterator(thrust::make_tuple(d_pos4, d_vel4)),
thrust::make_zip_iterator(thrust::make_tuple(d_pos4 + numParticles, d_vel4 + numParticles)),
thrust::for_each(thrust::make_zip_iterator(d_pos4, d_vel4),
thrust::make_zip_iterator(d_pos4 + numParticles, d_vel4 + numParticles),
integrate_functor(deltaTime));
}

View File

@@ -41,6 +41,9 @@
#include "thrust/iterator/zip_iterator.h"
#include "thrust/sort.h"
// for cuda::std::get
#include <cuda/std/utility>
namespace cg = cooperative_groups;
#include "helper_math.h"
#include "math_constants.h"
@@ -60,8 +63,8 @@ struct integrate_functor
template <typename Tuple> __device__ void operator()(Tuple t)
{
volatile float4 posData = thrust::get<0>(t);
volatile float4 velData = thrust::get<1>(t);
volatile float4 posData = cuda::std::get<0>(t);
volatile float4 velData = cuda::std::get<1>(t);
float3 pos = make_float3(posData.x, posData.y, posData.z);
float3 vel = make_float3(velData.x, velData.y, velData.z);
@@ -107,8 +110,8 @@ struct integrate_functor
}
// store new position and velocity
thrust::get<0>(t) = make_float4(pos, posData.w);
thrust::get<1>(t) = make_float4(vel, velData.w);
cuda::std::get<0>(t) = make_float4(pos, posData.w);
cuda::std::get<1>(t) = make_float4(vel, velData.w);
}
};