Commit 36f03c71 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

initialize gpu memory in CLLinkedCell.java.

parent aaf91397
Pipeline #88789 canceled with stages
......@@ -374,7 +374,15 @@ public class CLLinkedCell {
this.gridSize = CLUtils.toIntBuffer(iGridSize, CLUtils.toIntBuffer(iGridSize));
this.cellStarts = MemoryUtil.memAllocInt(numberOfGridCells);
for(int i = 0; i < numberOfGridCells; i++) {
this.cellStarts.put(i, 0);
}
this.cellEnds = MemoryUtil.memAllocInt(numberOfGridCells);
for(int i = 0; i < numberOfGridCells; i++) {
this.cellEnds.put(i, 0);
}
this.indices = MemoryUtil.memAllocInt(numberOfElements);
this.reorderedPositions = MemoryUtil.memAllocFloat(numberOfElements * 2);
}
......@@ -392,6 +400,8 @@ public class CLLinkedCell {
clReorderedPositions = clCreateBuffer(clContext, CL_MEM_READ_WRITE, 2 * 4 * numberOfElements, errcode_ret);
clPositions = clCreateBuffer(clContext, CL_MEM_READ_WRITE, 2 * 4 * numberOfElements, errcode_ret);
clEnqueueWriteBuffer(clQueue, clPositions, true, 0, positions, null, null);
clEnqueueWriteBuffer(clQueue, clCellStarts, true, 0, cellStarts, null, null);
clEnqueueWriteBuffer(clQueue, clCellEnds, true, 0, cellEnds, null, null);
}
}
......
......@@ -27,7 +27,7 @@ public class TestCLLinkedList {
private static Logger logger = Logger.getLogger(TestCLLinkedList.class);
private static Random random = new Random();
private static Random random = new Random(10);
@Before
public void setUp() throws Exception {}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment