Mercurial > hg > truffle
changeset 13754:785b2be9c85a
added work-around to handle CUDA context management in PTX C++ code
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 24 Jan 2014 18:03:09 +0100 |
parents | 80cd5c3b8827 |
children | 9c95e4917c40 |
files | graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTest.java |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTest.java Fri Jan 24 18:01:36 2014 +0100 +++ b/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTest.java Fri Jan 24 18:03:09 2014 +0100 @@ -69,7 +69,15 @@ Assume.assumeTrue(ptxBackend.isDeviceInitialized()); HotSpotNmethod installedPTXCode = installKernel(method, ptxCode); StructuredGraph wrapper = new PTXWrapperBuilder(method, installedPTXCode, (HotSpotProviders) getProviders()).getGraph(); - return super.getCode(method, wrapper); + + // The PTX C++ layer expects a 1:1 relationship between kernel compilation + // and kernel execution as it creates a cuContext in the former and + // destroys it in the latter. So, each kernel installed requires a unique + // wrapper. + // TODO: do cuContext management properly + boolean forceCompile = true; + + return getCode(method, wrapper, forceCompile); } protected static void compileAndPrintCode(PTXTest test) {