diff --git a/hat/backends/opencl/pom.xml b/hat/backends/opencl/pom.xml index 225c9eca2e0..de8a5d0fd02 100644 --- a/hat/backends/opencl/pom.xml +++ b/hat/backends/opencl/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 - oracle.code - hat-backend-opencl - 1.0 jar - - oracle.code + hat-backends 1.0 - hat.backends - + oracle.code + hat-backend-opencl + 1.0 oracle.code - 1.0 hat + 1.0 - - org.codehaus.mojo - exec-maven-plugin - - true - - + org.codehaus.mojo + exec-maven-plugin + + true + + - org.apache.maven.plugins maven-antrun-plugin @@ -66,19 +56,17 @@ questions. install + + run + - + - - run - - - diff --git a/hat/backends/pom.xml b/hat/backends/pom.xml index 2ab06059ae5..aaa6fb46201 100644 --- a/hat/backends/pom.xml +++ b/hat/backends/pom.xml @@ -1,6 +1,5 @@ - - - - - - 4.0.0 - oracle.code - 1.0 - hat.backends - pom - +--> + 4.0.0 + pom + oracle.code + hat-backends + 1.0 oracle.code + hat-root 1.0 - hat.root - - - opencl - cuda - mock - ptx - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - cmake_compile - compile - - exec - - - cmake - - -DHAT_TARGET=${hat.target} - -B - ${hat.target}/cmake-build-debug - - - - - cmake_install_build - install - - exec - - - cmake - - --build - ${hat.target}/cmake-build-debug - - - - - - cmake_clean - clean - - exec - - - rm - - -rf - cmake-build-debug - - - - - - - - - + + + oracle.code + hat + 1.0 + + + + ptx + opencl + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + cmake-compile + compile + + exec + + + cmake + + -DHAT_TARGET=${hat.target} + -B + ${hat.target}/cmake-build-debug + + + + + cmake_install_build + install + + exec + + + cmake + + --build + ${hat.target}/cmake-build-debug + + + + + cmake_clean + clean + + exec + + + rm + + -rf + cmake-build-debug + + + + + + + diff --git a/hat/backends/ptx/pom.xml b/hat/backends/ptx/pom.xml index 6c00a18d547..0bfe2f65550 100644 --- a/hat/backends/ptx/pom.xml +++ b/hat/backends/ptx/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 - oracle.code - hat-backend-ptx - 1.0 jar - - oracle.code + hat-backends 1.0 - hat.backends - + oracle.code + hat-backend-ptx + 1.0 oracle.code - 1.0 hat + 1.0 - org.codehaus.mojo - exec-maven-plugin - - true - - + org.codehaus.mojo + exec-maven-plugin + + true + + - org.apache.maven.plugins maven-antrun-plugin @@ -65,18 +56,17 @@ questions. install + + run + - + - - run - - diff --git a/hat/bldr/clean b/hat/bldr/clean new file mode 100644 index 00000000000..ae9fcfadb2b --- /dev/null +++ b/hat/bldr/clean @@ -0,0 +1 @@ +--enable-preview --source 24 clean diff --git a/hat/clean b/hat/clean new file mode 100644 index 00000000000..074ec08008d --- /dev/null +++ b/hat/clean @@ -0,0 +1,36 @@ +/* vim: set ft=java: + * + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import static bldr.Bldr.*; + +void main(String[] args) { + var hatDir = Dir.current(); + var buildDir = hatDir.buildDir("build").remove(); + hatDir.findDirs(path->path.getFileName().endsWith("target")) + .map(path->BuildDir.of(path)) + .peek(dir->println("removing " +dir.path())) + .forEach(dir->dir.remove()); +} diff --git a/hat/examples/blackscholes/pom.xml b/hat/examples/blackscholes/pom.xml index 0f50c62850b..bc7ffa708ac 100644 --- a/hat/examples/blackscholes/pom.xml +++ b/hat/examples/blackscholes/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 - oracle.code - hat-example-blackscholes - 1.0 jar - oracle.code + hat-examples 1.0 - hat.examples - + oracle.code + hat-example-blackscholes + 1.0 oracle.code - 1.0 hat + 1.0 - @@ -55,18 +48,17 @@ questions. install + + run + - + - - run - - diff --git a/hat/examples/heal/pom.xml b/hat/examples/heal/pom.xml index d1a270e809a..aca22a4ce5e 100644 --- a/hat/examples/heal/pom.xml +++ b/hat/examples/heal/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 + jar + + oracle.code + hat-examples + 1.0 + oracle.code hat-example-heal 1.0 - - - - oracle.code - 1.0 - hat.examples - - - oracle.code - 1.0 hat + 1.0 - @@ -56,18 +48,17 @@ questions. install + + run + - + - - run - - diff --git a/hat/examples/life/pom.xml b/hat/examples/life/pom.xml index 51325b2aeca..26407f3c88f 100644 --- a/hat/examples/life/pom.xml +++ b/hat/examples/life/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 + jar + + oracle.code + hat-examples + 1.0 + oracle.code hat-example-life 1.0 - jar - - - - oracle.code - 1.0 - hat.examples - - - oracle.code - 1.0 hat + 1.0 @@ -56,19 +48,17 @@ questions. install + + run + - + - - run - - - diff --git a/hat/examples/mandel/pom.xml b/hat/examples/mandel/pom.xml index b18789db2c5..79018d4d142 100644 --- a/hat/examples/mandel/pom.xml +++ b/hat/examples/mandel/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 - oracle.code - hat-example-mandel - 1.0 jar - oracle.code + hat-examples 1.0 - hat.examples - + oracle.code + hat-example-mandel + 1.0 oracle.code - 1.0 hat + 1.0 @@ -54,18 +48,17 @@ questions. install + + run + - + - - run - - diff --git a/hat/examples/pom.xml b/hat/examples/pom.xml index 2949e3ae05a..b918c86c145 100644 --- a/hat/examples/pom.xml +++ b/hat/examples/pom.xml @@ -1,6 +1,5 @@ - - - - - - 4.0.0 - oracle.code - 1.0 - hat.examples - pom - - - - oracle.code - 1.0 - hat.root - - - - mandel - - squares - violajones - heal - life - blackscholes - +--> + 4.0.0 + pom + oracle.code + hat-examples + 1.0 + + oracle.code + hat-root + 1.0 + + + + oracle.code + hat + 1.0 + + + + life + blackscholes + mandel + heal + violajones + squares + diff --git a/hat/examples/squares/pom.xml b/hat/examples/squares/pom.xml index d7c61523db1..1fd6f85f515 100644 --- a/hat/examples/squares/pom.xml +++ b/hat/examples/squares/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 - oracle.code - hat-example-squares - 1.0 jar - oracle.code + hat-examples 1.0 - hat.examples - + oracle.code + hat-example-squares + 1.0 oracle.code - 1.0 hat + 1.0 @@ -54,19 +48,17 @@ questions. install + + run + - + - - run - - - diff --git a/hat/examples/violajones/pom.xml b/hat/examples/violajones/pom.xml index 80ae86a9876..fdd09f6a69b 100644 --- a/hat/examples/violajones/pom.xml +++ b/hat/examples/violajones/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 - oracle.code - hat-example-violajones - 1.0 jar - oracle.code + hat-examples 1.0 - hat.examples - - + oracle.code + hat-example-violajones + 1.0 oracle.code - 1.0 hat + 1.0 @@ -55,19 +48,17 @@ questions. install + + run + - + - - run - - - diff --git a/hat/hat/pom.xml b/hat/hat/pom.xml index 61e773e201b..b7379e17d77 100644 --- a/hat/hat/pom.xml +++ b/hat/hat/pom.xml @@ -1,6 +1,5 @@ - - - +--> 4.0.0 - + jar oracle.code hat 1.0 - oracle.code + hat-root 1.0 - hat.root - - - org.junit.jupiter @@ -69,18 +61,17 @@ questions. install + + run + - + - - run - - diff --git a/hat/hat/src/main/test/hat/CustomOpTest.java b/hat/hat/src/main/test/hat/CustomOpTest.java index 00b4227cced..89728405bdf 100644 --- a/hat/hat/src/main/test/hat/CustomOpTest.java +++ b/hat/hat/src/main/test/hat/CustomOpTest.java @@ -31,6 +31,7 @@ import jdk.incubator.code.Value; import jdk.incubator.code.op.CoreOp; import jdk.incubator.code.Op; + import java.lang.reflect.Method; import jdk.incubator.code.type.JavaType; import jdk.incubator.code.CodeReflection; @@ -79,7 +80,7 @@ public TypeElement resultType() { @Test public void testDNAOp() throws NoSuchMethodException { Method method = CustomOpTest.class.getDeclaredMethod("addMul", int.class, int.class); - var funcOp = Op.of(method);//.getCodeModel().get(); + CoreOp.FuncOp funcOp = Op.ofMethod(method).get(); var transformed = funcOp.transform((builder, op) -> { CopyContext cc = builder.context(); if (op instanceof CoreOp.InvokeOp invokeOp) { diff --git a/hat/pom.xml b/hat/pom.xml index 9d91d6475b4..ea45ca1fa02 100644 --- a/hat/pom.xml +++ b/hat/pom.xml @@ -1,68 +1,71 @@ - - 4.0.0 - oracle.code - 1.0 - hat.root - pom - - UTF-8 - 24 - 24 - ${env.PWD}/build - + + + 4.0.0 + pom + oracle.code + hat-root + 1.0 + + UTF-8 + 24 + 24 + ${env.PWD}/build + + + + default + + true + + + backends + examples + hat + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + + --add-modules=jdk.incubator.code + --enable-preview + --add-exports=java.base/jdk.internal=ALL-UNNAMED + --add-exports=java.base/jdk.internal.vm.annotation=ALL-UNNAMED + + ${maven.compiler.source} + ${maven.compiler.target} + true + true + true + + + +