# HG changeset patch # User Doug Simon # Date 1404156159 -7200 # Node ID 0e36e8377c99daf7aef420dedacebff81d86f836 # Parent 75ea3123657f8088963f29401239ea506e23222f HSAIL: cannot reference OkraContext if it cannot be loaded diff -r 75ea3123657f -r 0e36e8377c99 graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/KernelTester.java --- a/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/KernelTester.java Mon Jun 30 19:01:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/KernelTester.java Mon Jun 30 21:22:39 2014 +0200 @@ -130,21 +130,14 @@ hsailMode = HsailMode.COMPILED; useLambdaMethod = false; - if (okraLibExists == false) { - // The okra native lib is not loaded yet, try to load the OkraContext - // explicitly and report a more useful error if there is a problem - try { - Class.forName("OkraContext"); - } catch (Exception e) { - logger.info("Okra native library cannot be found or loaded while running" + this.getClass().getSimpleName()); - this.okraLibExists = false; - return; - } + this.okraLibExists = okraLibExists || OkraUtil.okraLibExists(); + if (!this.okraLibExists) { + logger.info("Okra native library cannot be found or loaded while running" + this.getClass().getSimpleName()); + return; } - // Control which okra instances can run the tests (is Simulator is static). + // Control which okra instances can run the tests (isSimulator is static). onSimulator = OkraContext.isSimulator(); - this.okraLibExists = okraLibExists; } public abstract void runTest(); diff -r 75ea3123657f -r 0e36e8377c99 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMaxTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMaxTest.java Mon Jun 30 19:01:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMaxTest.java Mon Jun 30 21:22:39 2014 +0200 @@ -22,15 +22,17 @@ */ package com.oracle.graal.compiler.hsail.test.lambda; -import com.amd.okra.OkraContext; -import static com.oracle.graal.hotspot.HotSpotGraalRuntime.runtime; -import com.oracle.graal.hotspot.HotSpotVMConfig; +import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static org.junit.Assert.*; -import static org.junit.Assume.assumeTrue; +import static org.junit.Assume.*; + +import java.util.*; +import java.util.stream.*; + import org.junit.*; -import java.util.*; -import java.util.stream.IntStream; +import com.amd.okra.*; +import com.oracle.graal.hotspot.*; public class ReduceMaxTest { // The length of the input array @@ -76,7 +78,7 @@ public void testReduce() { // The simulator does not support HSA local memory as of June 2014 - assumeTrue(OkraContext.isSimulator() == false); + assumeTrue(OkraUtil.okraLibExists() && OkraContext.isSimulator() == false); // Handmade reduce does not support +UseCompressedOops HotSpotVMConfig config = runtime().getConfig(); diff -r 75ea3123657f -r 0e36e8377c99 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMinTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMinTest.java Mon Jun 30 19:01:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceMinTest.java Mon Jun 30 21:22:39 2014 +0200 @@ -22,15 +22,17 @@ */ package com.oracle.graal.compiler.hsail.test.lambda; -import com.amd.okra.OkraContext; -import static com.oracle.graal.hotspot.HotSpotGraalRuntime.runtime; -import com.oracle.graal.hotspot.HotSpotVMConfig; +import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static org.junit.Assert.*; -import static org.junit.Assume.assumeTrue; +import static org.junit.Assume.*; + +import java.util.*; +import java.util.stream.*; + import org.junit.*; -import java.util.*; -import java.util.stream.IntStream; +import com.amd.okra.*; +import com.oracle.graal.hotspot.*; public class ReduceMinTest { // The length of the input array @@ -76,7 +78,7 @@ public void testReduce() { // The simulator does not support HSA local memory as of June 2014 - assumeTrue(OkraContext.isSimulator() == false); + assumeTrue(OkraUtil.okraLibExists() && OkraContext.isSimulator() == false); // Handmade reduce does not support +UseCompressedOops HotSpotVMConfig config = runtime().getConfig(); diff -r 75ea3123657f -r 0e36e8377c99 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceSumTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceSumTest.java Mon Jun 30 19:01:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ReduceSumTest.java Mon Jun 30 21:22:39 2014 +0200 @@ -22,15 +22,17 @@ */ package com.oracle.graal.compiler.hsail.test.lambda; -import com.amd.okra.OkraContext; -import static com.oracle.graal.hotspot.HotSpotGraalRuntime.runtime; -import com.oracle.graal.hotspot.HotSpotVMConfig; -import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; +import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; +import static org.junit.Assert.*; +import static org.junit.Assume.*; + +import java.util.*; +import java.util.stream.*; + import org.junit.*; -import java.util.*; -import java.util.stream.IntStream; +import com.amd.okra.*; +import com.oracle.graal.hotspot.*; public class ReduceSumTest { // The length of the input array @@ -77,7 +79,7 @@ public void testReduce() { // The simulator does not support HSA local memory as of June 2014 - assumeTrue(OkraContext.isSimulator() == false); + assumeTrue(OkraUtil.okraLibExists() && OkraContext.isSimulator() == false); // Handmade reduce does not support +UseCompressedOops HotSpotVMConfig config = runtime().getConfig();