Fixed copying to device memory based on size of allocTables
authorAaron Becker <abecker3@illinois.edu>
Thu, 15 Mar 2007 00:32:44 +0000 (00:32 +0000)
committerAaron Becker <abecker3@illinois.edu>
Thu, 15 Mar 2007 00:32:44 +0000 (00:32 +0000)
src/libs/ck-libs/ParFUM-Tops/ParFUM_TOPS.C

index 78c274f330dc93d6d755f588067b9973cd2bdb46..ad2b658d4bb31b27a1e8acd2da7d95c278a57dcd 100644 (file)
@@ -118,8 +118,8 @@ TopModel* topModel_Create_Driver(int elem_attr_sz, int node_attr_sz, int model_a
         FEM_DataAttribute * at = (FEM_DataAttribute*) m->mesh->elem[0].lookup(FEM_DATA+0,"topModel_Create_Driver");
         AllocTable2d<unsigned char> &dataTable  = at->getChar();
         unsigned char *ElemData = dataTable.getData();
-        int size = at->size();
-        cudaMalloc(size, (void**)&(model->devive_model.ElemDataDevice));
+        int size = dataTable.size();
+        cudaMalloc(size, (void**)&(model->device_model.ElemDataDevice));
         cudaMemcpy(model->device_model.ElemDataDevice,ElemData,size,
                 cudaMemcpyHostToDevice);
     }
@@ -129,7 +129,7 @@ TopModel* topModel_Create_Driver(int elem_attr_sz, int node_attr_sz, int model_a
         FEM_DataAttribute * at = (FEM_DataAttribute*) m->mesh->node.lookup(FEM_DATA+0,"topModel_Create_Driver");
         AllocTable2d<unsigned char> &dataTable  = at->getChar();
         unsigned char *NodeData = dataTable.getData();
-        int size = at->size();
+        int size = dataTable.size();
         cudaMalloc(size, (void**)&(model->device_model.NodeDataDevice));
         cudaMemcpy(model->device_model.NodeDataDevice,NodeData,size,
                 cudaMemcpyHostToDevice);
@@ -140,7 +140,7 @@ TopModel* topModel_Create_Driver(int elem_attr_sz, int node_attr_sz, int model_a
         FEM_DataAttribute * at = (FEM_DataAttribute*) m->mesh->node.lookup(FEM_CONN,"topModel_Create_Driver");
         AllocTable2d<int> &dataTable  = at->getInt();
         int *data = dataTable.getData();
-        int size = at->size()*sizeof(int);
+        int size = dataTable.size()*sizeof(int);
         cudaMalloc(size, (void**)&(model->device_model.ElemConnDevice));
         cudaMemcpy(model->device_model.ElemConnDevice,data,size,
                 cudaMemcpyHostToDevice);