addedd more logic

This commit is contained in:
2020-02-20 07:56:23 +01:00
parent 3f6fd60777
commit c2a6e881be
3 changed files with 9 additions and 9 deletions
@@ -25,7 +25,12 @@ public class GpuTestSystem {
public void run() {
List<Task> tasks = getTasks();
// run tasks for the first time if some dlls are loaded lazily
tasks.forEach(Task::runTask);
// now run tasks to get the runtime performance
tasks.forEach(Task::runTask);
}
private List<Task> getTasks() {
@@ -1,7 +1,6 @@
package de.unidue.nes.gpu.initialization;
import org.bytedeco.opencv.global.opencv_core;
import org.bytedeco.opencv.opencv_core.GpuMat;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
@@ -26,9 +25,6 @@ public class Initializer {
if (count <= 0) {
throw new InitializationException("no cuda enabled device was found");
}
try (GpuMat gpuMat = new GpuMat()) {
System.out.println("address of some random GpuMat: " + gpuMat.address());
}
testInitialization();
}
@@ -2,7 +2,6 @@ package de.unidue.nes.gpu.tasks.taskdefinitions;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
@@ -30,7 +29,7 @@ public class MedianFilterTask implements Task {
Mat img = Imgcodecs.imread("src/main/resources/car.jpg");
Imgproc.resize(img, img, new Size(), 2.5, 2.5);
Imgproc.cvtColor(img, img, Imgproc.COLOR_BGR2GRAY);
HighGui.imshow("image for median filtering", img);
// HighGui.imshow("image for median filtering", img);
Mat cpuImg = new Mat();
Mat gpuImg = new Mat();
img.copyTo(cpuImg);
@@ -45,9 +44,9 @@ public class MedianFilterTask implements Task {
System.out.println("CPU processing time: " + (time2 - time1) + "ms");
System.out.println("GPU processing time: " + (time3 - time2) + "ms");
HighGui.imshow("CPU result", cpuImg);
HighGui.imshow("GPU result", gpuImg);
HighGui.waitKey();
// HighGui.imshow("CPU result", cpuImg);
// HighGui.imshow("GPU result", gpuImg);
// HighGui.waitKey();
}
}