diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cc0d059f78e79c77a335ba83dde26ebc9fd2af7f..8ee8b1c4aab7bd8acb57e210ed3faf618fc64b1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ include: stages: - build - test + - visualize - deploy variables: @@ -39,7 +40,16 @@ test-nvidia-gpu: script: - clinfo - if [[ "$(clinfo | grep 'Device Type')" != *"GPU"* ]]; then exit -1; fi - - mvn $MAVEN_CLI_OPTS test + - mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site + - mv target target-nvidia-gpu + artifacts: + when: always + reports: + junit: + - target-nvidia-gpu/surefire-reports/TEST-*.xml + - target-nvidia-gpu/failsafe-reports/TEST-*.xml + paths: + - target-nvidia-gpu tags: - opencl @@ -49,7 +59,16 @@ test-nvidia-cpu: script: - clinfo - if [[ "$(clinfo | grep 'Device Type')" == *"GPU"* ]]; then exit -1; fi - - mvn $MAVEN_CLI_OPTS test + - mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site + - mv target target-nvidia-cpu + artifacts: + when: always + reports: + junit: + - target-nvidia-cpu/surefire-reports/TEST-*.xml + - target-nvidia-cpu/failsafe-reports/TEST-*.xml + paths: + - target-nvidia-cpu tags: - compute @@ -59,7 +78,16 @@ test-amdgpu-cpu: script: - clinfo - if [[ "$(clinfo | grep 'Device Type')" == *"GPU"* ]]; then exit -1; fi - - mvn $MAVEN_CLI_OPTS test + - mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site + - mv target target-amdgpu-cpu + artifacts: + when: always + reports: + junit: + - target-amdgpu-cpu/surefire-reports/TEST-*.xml + - target-amdgpu-cpu/failsafe-reports/TEST-*.xml + paths: + - target-amdgpu-cpu tags: - compute @@ -69,10 +97,44 @@ test-pocl-cpu: script: - clinfo - if [[ "$(clinfo | grep 'Device Type')" == *"GPU"* ]]; then exit -1; fi - - mvn $MAVEN_CLI_OPTS test + - mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site + - mv target target-pocl-cpu + artifacts: + when: always + reports: + junit: + - target-pocl-cpu/surefire-reports/TEST-*.xml + - target-pocl-cpu/failsafe-reports/TEST-*.xml + paths: + - target-pocl-cpu tags: - compute +coverage: + stage: visualize # Must be in a stage later than test-jdk11's stage. The visualize stage does not exist by default. Please define it first, or chose an existing stage like deploy. + image: haynes/jacoco2cobertura:1.0.3 + script: + - 'python /opt/cover2cover.py target-nvidia-gpu/site/jacoco/jacoco.xml src/main/java > target-nvidia-gpu/site/cobertura.xml' + - 'python /opt/source2filename.py target-nvidia-gpu/site/cobertura.xml' + - 'python /opt/cover2cover.py target-nvidia-cpu/site/jacoco/jacoco.xml src/main/java > target-nvidia-cpu/site/cobertura.xml' + - 'python /opt/source2filename.py target-nvidia-cpu/site/cobertura.xml' + - 'python /opt/cover2cover.py target-amdgpu-cpu/site/jacoco/jacoco.xml src/main/java > target-amdgpu-cpu/site/cobertura.xml' + - 'python /opt/source2filename.py target-amdgpu-cpu/site/cobertura.xml' + - 'python /opt/cover2cover.py target-pocl-cpu/site/jacoco/jacoco.xml src/main/java > target-pocl-cpu/site/cobertura.xml' + - 'python /opt/source2filename.py target-pocl-cpu/site/cobertura.xml' + needs: ["test-nvidia-gpu", "test-nvidia-cpu", "test-amdgpu-cpu", "test-pocl-cpu"] + dependencies: + - test-nvidia-gpu + - test-nvidia-cpu + - test-amdgpu-cpu + - test-pocl-cpu + artifacts: + reports: + cobertura: target-nvidia-gpu/site/cobertura.xml + cobertura: target-nvidia-cpu/site/cobertura.xml + cobertura: target-amdgpu-cpu/site/cobertura.xml + cobertura: target-pocl-cpu/site/cobertura.xml + deploy: stage: deploy script: diff --git a/README.md b/README.md index f2a85b791ea073afe95d524104e18275e8ac3515..b5400527ca2a64542a85c64306323f54fa005e70 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@  [](http://git.qoto.org/aparapi/aparapi/-/commits/master) +[](http://git.qoto.org/aparapi/aparapi/commits/master) [](https://codecov.io/gh/Syncleus/aparapi) [](https://www.codacy.com/app/freemo/aparapi?utm_source=github.com&utm_medium=referral&utm_content=Syncleus/aparapi&utm_campaign=badger) [](http://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/pom.xml b/pom.xml index d579f2efea89eb12d26f43b3aa07138f61b0d62b..6806b50493abc6e8db0b85f9e62959b26397179a 100644 --- a/pom.xml +++ b/pom.xml @@ -148,30 +148,13 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> </plugin> - <plugin> - <groupId>com.github.github</groupId> - <artifactId>site-maven-plugin</artifactId> - <configuration> - <server>github</server> - <message>Creating site for aparapi</message> - <merge>true</merge> - </configuration> - <executions> - <execution> - <goals> - <goal>site</goal> - </goals> - <phase>site</phase> - </execution> - </executions> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkCount>6</forkCount> <reuseForks>false</reuseForks> - <argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine> + <argLine>@{argLine} -Xmx2048m -XX:MaxPermSize=512m</argLine> </configuration> </plugin> <plugin> diff --git a/src/test/java/com/aparapi/runtime/BarrierSupportTest.java b/src/test/java/com/aparapi/runtime/BarrierSupportTest.java index 239115e3307ecb603af20e23e6b408f972f50a1a..aa28aa0ad9bb8379cffff90ee0b28a9ab0c222f0 100644 --- a/src/test/java/com/aparapi/runtime/BarrierSupportTest.java +++ b/src/test/java/com/aparapi/runtime/BarrierSupportTest.java @@ -32,6 +32,8 @@ import java.util.List; import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; +import org.junit.Ignore; + public class BarrierSupportTest { protected static OpenCLDevice openCLDevice = null; @@ -61,7 +63,7 @@ public class BarrierSupportTest { public static void classTeardown() { Util.resetKernelManager(); } - + @Before public void setUpBefore() throws Exception { KernelManager.setKernelManager(new CLKernelManager()); @@ -72,6 +74,7 @@ public class BarrierSupportTest { } @Test + @Ignore("Known bug, reported as Issue #2.") public void testBarrier1() { final Barrrier1Kernel kernel = new Barrrier1Kernel(SIZE); try { @@ -85,8 +88,9 @@ public class BarrierSupportTest { kernel.dispose(); } } - + @Test + @Ignore("Known bug, reported as Issue #2.") public void testBarrier1Explicit() { final Barrrier1Kernel kernel = new Barrrier1Kernel(SIZE); try { @@ -124,6 +128,7 @@ public class BarrierSupportTest { } @Test + @Ignore("Known bug, reported as Issue #2.") public void testBarrier2() { final Barrrier2Kernel kernel = new Barrrier2Kernel(SIZE); try { @@ -137,8 +142,9 @@ public class BarrierSupportTest { kernel.dispose(); } } - + @Test + @Ignore("Known bug, reported as Issue #2.") public void testBarrier2Explicit() { final Barrrier2Kernel kernel = new Barrrier2Kernel(SIZE); try { @@ -182,7 +188,7 @@ public class BarrierSupportTest { } return inputArray; } - + private boolean validate() { int[] inputArray = initInputArray(); int[] expected = new int[SIZE]; @@ -208,22 +214,22 @@ public class BarrierSupportTest { } assertArrayEquals("targetArray", expected, targetArray); - + return true; } private static class Barrrier1Kernel extends Kernel { private final int SIZE; private int[] resultArray; - + @Local private int[] myArray; - + private Barrrier1Kernel(int size) { this.SIZE = size; myArray = new int[size]; } - + @NoCL public void setArray(int[] target) { resultArray = target; @@ -233,17 +239,17 @@ public class BarrierSupportTest { int targetId = (SIZE - 1) - ((id + SIZE/2) % SIZE); target[targetId] = source[id]; } - + private void doComputation1(@Local int[] arr, int id) { for (int i = 0; i < SIZE; i++) { arr[id] += i; } } - + @Override public void run() { - int id = getLocalId(); - + int id = getLocalId(); + doInitialCopy(myArray, resultArray, id); localBarrier(); doComputation1(myArray, id); @@ -255,19 +261,19 @@ public class BarrierSupportTest { } } } - + private static class Barrrier2Kernel extends Kernel { private final int SIZE; private int[] resultArray; - + @Local private int[] myArray; - + private Barrrier2Kernel(int size) { this.SIZE = size; myArray = new int[size]; } - + @NoCL public void setArray(int[] target) { resultArray = target; @@ -277,17 +283,17 @@ public class BarrierSupportTest { int targetId = (SIZE - 1) - ((id + SIZE/2) % SIZE); target[targetId] = source[id]; } - + private void doComputation1(@Local int[] arr, int id) { for (int i = 0; i < SIZE; i++) { arr[id] += i; } } - + @Override public void run() { - int id = getLocalId(); - + int id = getLocalId(); + doInitialCopy(myArray, resultArray, id); localGlobalBarrier(); doComputation1(myArray, id);