00001 00011 #ifndef __PARFUM_TOPS_CUDA___H 00012 #define __PARFUM_TOPS_CUDA___H 00013 00014 #include "ParFUM_TOPS_Types.h" 00015 00016 00017 #ifdef CUDA 00018 00019 #include <cutil.h> 00020 00022 typedef struct { 00023 unsigned node_attr_size; 00024 unsigned elem_attr_size; 00025 unsigned model_attr_size; 00026 00027 unsigned num_local_elem; 00028 unsigned num_local_node; 00029 00031 void *mAttDevice; 00032 void *ElemDataDevice; 00033 void *NodeDataDevice; 00034 int *ElemConnDevice; 00035 int *n2eConnDevice; 00036 } TopModelDevice; 00037 00038 00039 #define topElement_D_GetAttrib(m, e) (((char*)(m)->ElemDataDevice) + (e.idx)*(m)->elem_attr_size) 00040 00041 #define topNode_D_GetAttrib(m, n) (((char*)(m)->NodeDataDevice) + n*(m)->node_attr_size) 00042 00043 #define topElement_D_GetNode(m, e, i) (((m)->ElemConnDevice)[(e.idx) * 4 + i]) 00044 00045 #endif 00046 #endif