Module tornado.api

Interface TaskGraphInterface

All Known Implementing Classes:
TaskGraph

public interface TaskGraphInterface
Base interface of the Tornado API.
  • Method Details

    • addTask

      TaskGraphInterface addTask(TaskPackage taskPackage)
      It adds a task by using a TaskPackage.
      Parameters:
      taskPackage - TaskPackage
      Returns:
      invalid @link
      {@link @TornadoAPI
      }
    • task

      Adds task with no parameter.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with one argument
      Returns:
      TaskGraphInterface
    • task

      <T1> TaskGraphInterface task(String id, TornadoFunctions.Task1<T1> code, T1 arg)
      Adds task with one parameter.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with one argument
      arg - Argument to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2> TaskGraphInterface task(String id, TornadoFunctions.Task2<T1,T2> code, T1 arg1, T2 arg2)
      Adds task with two parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with two arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3> TaskGraphInterface task(String id, TornadoFunctions.Task3<T1,T2,T3> code, T1 arg1, T2 arg2, T3 arg3)
      Add task with three parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with three arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4> TaskGraphInterface task(String id, TornadoFunctions.Task4<T1,T2,T3,T4> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
      Adds task with four parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with four arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5> TaskGraphInterface task(String id, TornadoFunctions.Task5<T1,T2,T3,T4,T5> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
      Adds task with five parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with five arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6> TaskGraphInterface task(String id, TornadoFunctions.Task6<T1,T2,T3,T4,T5,T6> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
      Adds task with six parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with six arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7> TaskGraphInterface task(String id, TornadoFunctions.Task7<T1,T2,T3,T4,T5,T6,T7> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
      Adds task with seven parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with seven arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8> TaskGraphInterface task(String id, TornadoFunctions.Task8<T1,T2,T3,T4,T5,T6,T7,T8> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
      Adds task with eight parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with eight arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8, T9> TaskGraphInterface task(String id, TornadoFunctions.Task9<T1,T2,T3,T4,T5,T6,T7,T8,T9> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
      Adds task with nine parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with nine arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      arg9 - Argument 9 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> TaskGraphInterface task(String id, TornadoFunctions.Task10<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10)
      Adds task with 10 parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with 10 arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      arg9 - Argument 9 to the method
      arg10 - Argument 10 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> TaskGraphInterface task(String id, TornadoFunctions.Task11<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11)
      It creates a task with 11 parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with 10 arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      arg9 - Argument 9 to the method
      arg10 - Argument 10 to the method
      arg11 - Argument 11 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> TaskGraphInterface task(String id, TornadoFunctions.Task12<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12)
      It creates a task with 12 parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with 10 arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      arg9 - Argument 9 to the method
      arg10 - Argument 10 to the method
      arg11 - Argument 11 to the method
      arg12 - Argument 12 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> TaskGraphInterface task(String id, TornadoFunctions.Task13<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13)
      It creates a task with 13 parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with 10 arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      arg9 - Argument 9 to the method
      arg10 - Argument 10 to the method
      arg11 - Argument 11 to the method
      arg12 - Argument 12 to the method
      arg13 - Argument 13 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> TaskGraphInterface task(String id, TornadoFunctions.Task14<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14)
      It creates a task with 14 parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with 10 arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      arg9 - Argument 9 to the method
      arg10 - Argument 10 to the method
      arg11 - Argument 11 to the method
      arg12 - Argument 12 to the method
      arg13 - Argument 13 to the method
      arg14 - Argument 14 to the method
      Returns:
      TaskGraphInterface
    • task

      <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> TaskGraphInterface task(String id, TornadoFunctions.Task15<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15)
      It creates a task with 15 parameters.
      Parameters:
      id - Task-id
      code - Reference to an existing Java method with 15 arguments
      arg1 - Argument 1 to the method
      arg2 - Argument 2 to the method
      arg3 - Argument 3 to the method
      arg4 - Argument 4 to the method
      arg5 - Argument 5 to the method
      arg6 - Argument 6 to the method
      arg7 - Argument 7 to the method
      arg8 - Argument 8 to the method
      arg9 - Argument 9 to the method
      arg10 - Argument 10 to the method
      arg11 - Argument 11 to the method
      arg12 - Argument 12 to the method
      arg13 - Argument 13 to the method
      arg14 - Argument 14 to the method
      arg15 - Argument 15 to the method
      Returns:
      TaskGraphInterface
    • prebuiltTask

      TaskGraphInterface prebuiltTask(String id, String entryPoint, String filename, AccessorParameters accessorParameters)
    • prebuiltTask

      TaskGraphInterface prebuiltTask(String id, String entryPoint, String filename, AccessorParameters accessorParameters, int[] atomics)
      Add a pre-built OpenCL task into a task-schedule with atomics region.
      Parameters:
      id - Task-id
      entryPoint - Kernel's name of the entry point
      filename - Input OpenCL C Kernel
      atomics - Atomics region.
      Returns:
      TaskGraphInterface
    • getTaskGraphName

      String getTaskGraphName()
      Obtains the task-schedule name that was assigned.
      Returns:
      String
    • transferToDevice

      TaskGraphInterface transferToDevice(int mode, Object... objects)
      Tag a set of objects (Java objects) to be transferred to the device. There are three modes:

      DataTransferMode.FIRST_EXECUTION: it transfers data only the first execution of the task-graph (READ ONLY)

      DataTransferMode.EVERY_EXECUTION: it transfers data for every execution of the task-graph (READ/WRITE)

      Parameters:
      mode - A mode from DataTransferMode
      objects - List of Java objects (usually arrays) to be transferred to the device.
      Returns:
      TaskGraphInterface
    • consumeFromDevice

      TaskGraph consumeFromDevice(String uniqueTaskGraphName, Object... objects)
    • consumeFromDevice

      TaskGraph consumeFromDevice(Object... objects)
    • transferToHost

      TaskGraphInterface transferToHost(int mode, Object... objects)
      Tag a set of objects (Java objects) to be transferred from the device to the host after the execution completes. There are two modes:

      DataTransferMode.EVERY_EXECUTION: transfers data for every execution of the task-graph (WRITE only)

      DataTransferMode.UNDER_DEMAND: it transfers data only under demand. Data are not transferred unless the execution-plan, an TornadoExecutionPlan object, invokes the `transferToHost` function. This is used for optimization of data transfers.

      Parameters:
      mode - A mode from DataTransferMode
      objects - List of Java objects (usually arrays) to be transferred to the device.
      Returns:
      TaskGraphInterface
    • persistOnDevice

      TaskGraph persistOnDevice(Object... objects)
    • snapshot

      ImmutableTaskGraph snapshot()
      Function that closes a task-graph definition and creates an immutable task-graph ready for execution.
      Returns:
      ImmutableTaskGraph