Skip to content

Can't use Buffers/MemorySegments with TornadoVM #623

Open
@nailh-boop

Description

Describe the bug

When I try to initialize DoubleArray with DoubleBuffer or MemorySegment, the error appears.

WARNING: Code Bailout to Java sequential. Use --debug to see the reason [0m
 [2m2025-02-10T16:25:49.566+04:00 [0;39m  [31mERROR [0;39m  [35m13780 [0;39m  [2m--- [collision] [pool-1-thread-1]  [0;39m [36mc.pirsbim.collision.gpu.DataAccumulator  [0;39m  [2m: [0;39m 

uk.ac.manchester.tornado.api.exceptions.TornadoBailoutRuntimeException:  [31mUnable to build sketch for method: calculateSignedDistancesMultipleModelsByIndexes ( [31mUnable to build sketch for method: getAtIndex (Cannot invoke "jdk.vm.ci.meta.ResolvedJavaType.getAnnotation(java.lang.Class)" because the return value of "org.graalvm.compiler.core.common.type.ObjectStamp.type()" is null) [0m) [0m
  at [email protected]/uk.ac.manchester.tornado.runtime.sketcher.TornadoSketcher.buildSketch(TornadoSketcher.java:195) ~[tornado-runtime-1.0.9.jar:na]
  at [email protected]/uk.ac.manchester.tornado.runtime.sketcher.TornadoSketcher$TornadoSketcherCallable.call(TornadoSketcher.java:267) ~[tornado-runtime-1.0.9.jar:na]
  at [email protected]/uk.ac.manchester.tornado.runtime.sketcher.TornadoSketcher$TornadoSketcherCallable.call(TornadoSketcher.java:257) ~[tornado-runtime-1.0.9.jar:na]
  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
  at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

How To Reproduce

        DoubleBuffer buffer = DoubleBuffer.allocate(someArray.length);
        buffer.put(someArray);
        buffer.flip();
        DoubleArray doubleArray = DoubleArray.fromDoubleBuffer(buffer);

or

	MemorySegment a = MemorySegment.ofArray(someArray);
	dataA = DoubleArray.fromSegment(a);

Computing system setup (please complete the following information):

  • OS: Windows 10
  • Compute Capability 8.6 cuda 12.5

Metadata

Assignees

Labels

bugSomething isn't workingruntime

Type

Projects

  • Status

    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions