import uk.ac.manchester.tornado.api.ImmutableTaskGraph;
import uk.ac.manchester.tornado.api.TaskGraph;
import uk.ac.manchester.tornado.api.TornadoExecutionPlan;
import uk.ac.manchester.tornado.api.annotations.Parallel;
import uk.ac.manchester.tornado.api.enums.DataTransferMode;
import uk.ac.manchester.tornado.api.types.arrays.IntArray;
public class Main {
public static void invert(IntArray a, IntArray b, int size) {
for (@Parallel int i = 0; i < size; i++) {
b.set(i, ~a.get(i));
}
}
public static void main(String[] args) {
int size = 4096;
IntArray a = new IntArray(size);
IntArray b = new IntArray(size);
a.init(1);
b.init(0);
TaskGraph graph = new TaskGraph("s0")
.transferToDevice(DataTransferMode.FIRST_EXECUTION, a, b)
.task("t0", Main::invert, a, b, size)
.transferToHost(DataTransferMode.EVERY_EXECUTION, b);
ImmutableTaskGraph immutableTaskGraph = graph.snapshot();
TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph);
executionPlan.execute();
}
}
Expected behavior
It should compile and run normally.
Computing system setup (please complete the following information):
Describe the bug
PTX compilation fails when using the not bitwise operator "~" on an int :
How To Reproduce
Just run the following code :
Expected behavior
It should compile and run normally.
Computing system setup (please complete the following information):
Additional context
This works fine with an opencl backend.