问题描述
如果我想将下面的结构 TetrahedronStruct 移动到 CUDA 设备内存,我应该如何进行?
If I want to move the below structure TetrahedronStruct to CUDA device memory, how should I proceed?
struct TetrahedronStruct {
int index;
int region;
TriangleFaces Faces[4];
Vertex Vertices[4];
struct TetrahedronStruct *adjTetrahedrons[4];
};
typedef struct {
long double Nx, Ny, Nz;
long double d;
Vertex V[3];
} TriangleFaces;
typedef struct {
long double x, y, z;
} Vertex;
详情:
提供了网格细节(节点数、四面体、坐标和区域).树的创建是在 for 循环中完成的.基本上,每个人脸都根据其坐标和相邻关系在树中定位和排列.
The mesh details (number of nodes, tetrahedrons, coordinates, and regions) are provided. The creation of the tree is done in a for-loop. Basically, each face is being located and arranged in the tree accordingly with its coordinates and adjacency.
在 CUDA 设备中,我需要使用此结构叠加在媒体上以模拟粒子将如何穿过该媒体.百万粒子中的每一个都在从四面体移动到四面体(每个四面体都具有其所在介质的属性).
In the CUDA device, I need to use this structure to overlay on a media to simulate how particles will travel across that media. Each of the million particles are moving from tetrahedron to tetrahedron (each tetrahedron has the properties of the media where it resides).
推荐答案
将结构线性化,然后将它们复制到设备会更容易.
It will be easier to linearize the structures and then copy them to device.
在新的 CUDA 6 深拷贝中,只要您的计算能力是 3.x 或更高,并且使用 统一内存.
In the new CUDA 6 deep copies will be much easier as long as your compute capability is 3.x or higher with the Unified Memory.
这篇关于如何将四面体树结构复制到 CUDA 设备内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)