Commit 49b9dc91 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen

extend CLDistMesh from CLOperation.

parent 27da0fa3
Pipeline #264552 failed with stages
in 1 minute and 50 seconds
......@@ -196,7 +196,12 @@ public class CLEikMesh implements IMeshImprover<AVertex, AHalfEdge, AFace>, ITri
}
numberOfIterations++;
return clDistMesh.step(flipAll);
try {
return clDistMesh.step(flipAll);
} catch (OpenCLException e) {
e.printStackTrace();
return false;
}
/*log.info("#illegalMovementTests: " + numberOfIllegalMovementTests);
log.info("#retriangulations: " + numberOfRetriangulations);
log.info("#steps: " + numberOfIterations);
......@@ -204,7 +209,11 @@ public class CLEikMesh implements IMeshImprover<AVertex, AHalfEdge, AFace>, ITri
}
public void finish() {
clDistMesh.finish();
try {
clDistMesh.finish();
} catch (OpenCLException e) {
e.printStackTrace();
}
}
public void refresh() {
......
......@@ -56,21 +56,23 @@ public class VisualTestGPUEdgeBased {
overAllTime.resume();
meshGenerator.improve();
overAllTime.suspend();
meshGenerator.refresh();
synchronized (meshGenerator.getMesh()) {
meshGenerator.refresh();
}
try {
Thread.sleep(100);
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
distmeshPanel.repaint();
}
overAllTime.stop();
log.info("#vertices: " + meshGenerator.getMesh().getVertices().size());
log.info("#edges: " + meshGenerator.getMesh().getEdges().size());
log.info("#faces: " + meshGenerator.getMesh().getFaces().size());
log.info("quality: " + meshGenerator.getQuality());
log.info("overall time: " + overAllTime.getTime() + "[ms]");
meshGenerator.finish();
System.out.println("#vertices: " + meshGenerator.getMesh().getVertices().size());
System.out.println("#edges: " + meshGenerator.getMesh().getEdges().size());
System.out.println("#faces: " + meshGenerator.getMesh().getFaces().size());
System.out.println("quality: " + meshGenerator.getQuality());
System.out.println("overall time: " + overAllTime.getTime() + "[ms]");
}
......
......@@ -66,11 +66,11 @@ public class VisualTestGPUVertexBased {
overAllTime.stop();
meshGenerator.finish();
log.info("#vertices: " + meshGenerator.getMesh().getVertices().size());
log.info("#edges: " + meshGenerator.getMesh().getEdges().size());
log.info("#faces: " + meshGenerator.getMesh().getFaces().size());
log.info("quality: " + meshGenerator.getQuality());
log.info("overall time: " + overAllTime.getTime() + "[ms]");
System.out.println("#vertices: " + meshGenerator.getMesh().getVertices().size());
System.out.println("#edges: " + meshGenerator.getMesh().getEdges().size());
System.out.println("#faces: " + meshGenerator.getMesh().getFaces().size());
System.out.println("quality: " + meshGenerator.getQuality());
System.out.println("overall time: " + overAllTime.getTime() + "[ms]");
}
public static void main(String[] args) throws OpenCLException {
......
......@@ -124,7 +124,7 @@ public class CLDistMeshHE {
private AMesh mesh;
private boolean doublePrecision = true;
private boolean doublePrecision = false;
private boolean profiling = false;
private boolean hasToRead = false;
......@@ -189,9 +189,9 @@ public class CLDistMeshHE {
clGetPlatformIDs(platformIDs, numberOfPlatforms);
clPlatform = platformIDs.get(0);
clGetDeviceIDs(clPlatform, CL_DEVICE_TYPE_GPU, null, numberOfDevices);
clGetDeviceIDs(clPlatform, CL_DEVICE_TYPE_CPU, null, numberOfDevices);
PointerBuffer deviceIDs = stack.mallocPointer(numberOfDevices.get(0));
clGetDeviceIDs(clPlatform, CL_DEVICE_TYPE_GPU, deviceIDs, numberOfDevices);
clGetDeviceIDs(clPlatform, CL_DEVICE_TYPE_CPU, deviceIDs, numberOfDevices);
clDevice = deviceIDs.get(0);
printDeviceInfo(clDevice, "CL_DEVICE_NAME", CL_DEVICE_NAME);
......
Markdown is supported
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