0
:クーダスラスト - 私は通常、次の操作を行いフロートのアレイ上の削減を実行したい最大vec3
float res = *thrust::max_element(thrust::device,
thrust::device_ptr<float>(dDensities),
thrust::device_ptr<float>(dDensities+numParticles)
);
は、しかし、私が今やりたいものをvec3にほとんど同じことです(GLMライブラリタイプ)配列:
float res = *thrust::max_element(thrust::device,
thrust::device_ptr<glm::vec3>(dDensities),
thrust::device_ptr<glm::vec3>(dDensities+numParticles)
);
あなたが見ることができるように「<」演算子は、上で定義されていないため、これは何の意味もありません。しかし、私は彼の長さに基づいて最大vec3を取得したいと思います:
len = sqrtf(v.x*v.x + v.y*v.y + v.z*v.z);
それは可能ですか?