C API

Typedefs

typedef struct _iris_task iris_task
typedef struct _iris_mem iris_mem
typedef struct _iris_kernel iris_kernel
typedef struct _iris_graph iris_graph
typedef int (*iris_host_task)(void *params, const int *device)
typedef int (*command_handler)(void *params, void *device)
typedef int (*hook_task)(void *task)
typedef int (*hook_command)(void *command)
typedef int (*iris_selector_kernel)(iris_task task, void *params, char *kernel_name)

Functions

int iris_init(int *argc, char ***argv, int sync)

Initializes the IRIS execution environment.

This function initializes the IRIS execution environment.

Parameters
  • argc – pointer to the number of arguments

  • argv – argument array

  • sync – 0: non-blocking, 1: blocking

Returns

This functions return an error value. IRIS_SUCCESS, IRIS_ERROR

int iris_error_count()

Return number of errors occurred in IRIS.

Returns

This function returns the number of errors

int iris_finalize()

Terminates the IRIS execution environment.

this funciton put end to IRIS execution environment.

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_synchronize()

Puts a synchronization for tasks to complete.

This function makes IRIS Wait for all the submitted tasks to complete.

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

void iris_task_retain(iris_task task, bool flag)

Makes sure a can be submitted again and again.

This function makes a task with an option to be submitted again and again.

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_env_set(const char *key, const char *value)

Sets an IRIS environment variable.

Parameters
  • key – key string

  • value – value to be stored into key

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_env_get(const char *key, char **value, size_t *vallen)

Gets an IRIS environment variable.

Parameters
  • key – key string

  • value – pointer to the value to be retrieved

  • vallen – size in bytes of value

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_platform_count(int *nplatforms)

Returns the number of platforms.

Parameters

nplatforms – pointer to the number of platform

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_platform_info(int platform, int param, void *value, size_t *size)

Returns the platform information.

Parameters
  • platform – platform number

  • param – information type

  • value – information value

  • size – size in bytes of value

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_set_shared_memory_model(int flag)

Sets shared memory model.

Using this function shared memory model can be set

Parameters

flag – 0: non shared memory, 1: shared memory

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

void iris_set_enable_profiler(int flag)

Enable/disable profiler.

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_device_count(int *ndevs)

Returns the number of devices.

Parameters

ndevs – pointer to the number of devices

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_device_info(int device, int param, void *value, size_t *size)

Returns the device information.

Parameters
  • device – device number

  • param – information type

  • value – information value

  • size – size in bytes of value

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_device_set_default(int device)

Sets the default device.

Using this function default device can be set

Parameters

device – integer value representing the desired default device

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_device_get_default(int *device)

Gets the default device.

Using this function default device can be obtained

Parameters

device – IRIS returns the default device on this variable

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_device_synchronize(int ndevs, int *devices)

Waits for all the submitted tasks in a device to complete.

Parameters
  • ndevs – number of devices

  • devices – device array

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_register_policy(const char *lib, const char *name, void *params)

Registers a new device selector.

Parameters
  • lib – shared library path

  • name – selector name

  • params – parameter to the selector init function

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_register_command(int tag, int device, command_handler handler)

Registers a custom command specific to the device with the given command handler.

Parameters
  • tag – unique identification to register the custom command

  • device – device selection (iris_openmp, iris_cuda, iris_hip, iris_levelzero, iris_opencl)

  • handler – handler function for the command

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_register_hooks_task(hook_task pre, hook_task post)

Register functions to be called for each task before execution and after execution.

Parameters
  • pre – Function with signature int (*function)(void *task) to be called before task execution

  • post – Function with signature int (*function)(void *task) to be called after task execution

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_register_hooks_command(hook_command pre, hook_command post)

Register functions to be called for each command before execution and after execution.

Parameters
  • pre – Function with signature int (*function)(void *task) to be called before command execution

  • post – Function with signature int (*function)(void *task) to be called after command execution

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_kernel_create(const char *name, iris_kernel *kernel)

Creates a kernel with a given name.

Parameters
  • name – kernel name string

  • kernel

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_kernel_get(const char *name, iris_kernel *kernel)

Creates a kernel with a given name.

Parameters
  • name – kernel name string

  • kernel – a pointer to a kernel object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_kernel_setarg(iris_kernel kernel, int idx, size_t size, void *value)

Sets the arguments for a given kernel.

Parameters
  • kernel – a kernel object

  • idx – index of the parameter

  • size – size of the argument

  • value – value that needs to be set

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_kernel_setmem(iris_kernel kernel, int idx, iris_mem mem, size_t mode)

Sets memory object as an arguments for a given kernel.

Parameters
  • kernel – a kernel object

  • idx – index of the parameter

  • mem – iris memory object

  • mode – specifying the mode of the memory object iris_r, iris_w, or iris_rw

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_kernel_setmem_off(iris_kernel kernel, int idx, iris_mem mem, size_t off, size_t mode)

Sets memory object as an arguments with an offset for a given kernel.

Parameters
  • kernel – a kernel object

  • idx – index of the parameter

  • mem – iris memory object

  • off – offset for the memory object

  • mode – specifying the mode of the memory object iris_r, iris_w, or iris_rw

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_kernel_release(iris_kernel kernel)

Release a kernel.

Parameters

kernel – a kernel object that is to be releases

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_create(iris_task *task)

Creates a new task.

Parameters

task – pointer of the new task

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_create_perm(iris_task *task)

Creates a task with permanent life time. Task memory won’t be released after execution. It can’t be used to submit the task again and again. Application programmer should call task release API after successful completion of the task executions.

Parameters

task – the task pointer

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_create_name(const char *name, iris_task *task)

Creates a task with a given name.

Using this function IRIS creates a task object where the name is set from the function argument

Parameters
  • name – name of the task

  • task – the task pointer

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_depend(iris_task task, int ntasks, iris_task *tasks)

Adds a dependency to a task.

Adds a dependency to a task.

Parameters
  • task – source task

  • ntasks – number of tasks

  • tasks – target tasks array

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_malloc(iris_task task, iris_mem mem)

Mallocs for a memory object in a given task.

Parameters
  • task – iris task object

  • mem – memory object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_cmd_reset_mem(iris_task task, iris_mem mem, uint8_t reset)

Resets a memory object for a given task.

Parameters
  • task – iris task object

  • mem – memory object

  • reset – using the value the memory object is initialized

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_get_metadata(iris_task brs_task, int index)

Gets task meta data.

This function used for getting optional task metadata through the specified index

Parameters
  • brs_task – iris task object

  • index – index to obtain the correct meta data

Returns

returns the metadata for that index

int iris_task_set_metadata(iris_task brs_task, int index, int metadata)

Sets task meta data.

This function used for setting optional task metadata through the specified index

Parameters
  • brs_task – iris task object

  • index – index to set the correct meta data

  • meta_data – the meta data needs to be saved

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_h2broadcast(iris_task task, iris_mem mem, size_t off, size_t size, void *host)

Adds a H2Broadcast command to the target task.

Parameters
  • task – target task

  • mem – target memory object

  • off – offset in bytes

  • size – size in bytes

  • host – source host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_h2broadcast_offsets(iris_task task, iris_mem mem, size_t *off, size_t *host_sizes, size_t *dev_sizes, size_t elem_size, int dim, void *host)

Adds a H2Broadcast command to the target task that broadcast a portion of the memory.

Parameters
  • task – target task

  • mem – target memory object

  • off – offset in bytes

  • host_sizes – size in bytes for host

  • dev_sizes – size in bytes for host

  • elem_size – size of an element

  • dim – dimension of the memory

  • host – source host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_h2broadcast_full(iris_task task, iris_mem mem, void *host)

Adds a H2Broadcast command to the target task that broadcasts the full host memory.

Parameters
  • task – target task

  • mem – target memory object

  • host – source host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_d2d(iris_task task, iris_mem mem, size_t off, size_t size, void *host, int src_dev)

Adds a D2D command to the target task.

Parameters
  • task – target task

  • mem – target memory object

  • off – offset in bytes

  • size – size in bytes

  • host – source host address

  • src_dev

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_h2d(iris_task task, iris_mem mem, size_t off, size_t size, void *host)

Adds a H2D command to the target task.

Parameters
  • task – target task

  • mem – target memory object

  • off – offset in bytes

  • size – size in bytes

  • host – source host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_h2d_offsets(iris_task task, iris_mem mem, size_t *off, size_t *host_sizes, size_t *dev_sizes, size_t elem_size, int dim, void *host)

Adds a H2D command to the target task for a portion of the memory.

Parameters
  • task – target task

  • mem – target memory object

  • off – offset in bytes

  • host_sizes – indexes for specifying host memory size

  • dev_sizes – indexes for specifying device memory size

  • elem_size – size of each element

  • dim – dimension of the memory object

  • host – source host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_d2h(iris_task task, iris_mem mem, size_t off, size_t size, void *host)

Adds a D2H command to the target task.

Parameters
  • task – target task

  • mem – source memory object

  • off – offset in bytes

  • size – size in bytes

  • host – target host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_d2h_offsets(iris_task task, iris_mem mem, size_t *off, size_t *host_sizes, size_t *dev_sizes, size_t elem_size, int dim, void *host)

Adds a D2H command to the target task for a portion of the memory.

Parameters
  • task – target task

  • mem – target memory object

  • off – offset in bytes

  • host_sizes – indexes for specifying host memory size

  • dev_sizes – indexes for specifying device memory size

  • elem_size – size of each element

  • dim – dimension of the memory object

  • host – source host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_dmem_flush_out(iris_task task, iris_mem mem)

Adds a flush command to a task.

This function flushes the given memory object to host

Parameters
  • task – iris task object

  • mem – iris memory object that is specifed to the flush to host side

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_h2d_full(iris_task task, iris_mem mem, void *host)

Adds a H2D command with the size of the target memory to the target task.

Parameters
  • task – target task

  • mem – target memory object

  • host – source host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_d2h_full(iris_task task, iris_mem mem, void *host)

Adds a D2H command with the size of the source memory to the target task.

Parameters
  • task – target task

  • mem – source memory object

  • host – target host address

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_kernel_object(iris_task task, iris_kernel kernel, int dim, size_t *off, size_t *gws, size_t *lws)

Launches a kernel.

Parameters
  • task – target task

  • kernel – kernel name

  • dim – dimension

  • off – global workitem space offsets

  • gws – global workitem space

  • lws – local workitem space

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_kernel(iris_task task, const char *kernel, int dim, size_t *off, size_t *gws, size_t *lws, int nparams, void **params, int *params_info)

Launches a kernel.

Parameters
  • task – target task

  • kernel – kernel name

  • dim – dimension

  • off – global workitem space offsets

  • gws – global workitem space

  • lws – local workitem space

  • nparams – number of kernel parameters

  • params – kernel parameters

  • params_info – kernel parameters information

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_kernel_v2(iris_task task, const char *kernel, int dim, size_t *off, size_t *gws, size_t *lws, int nparams, void **params, size_t *params_off, int *params_info)

Launches a kernel with parameter offset.

Parameters
  • task – target task

  • kernel – kernel name

  • dim – dimension

  • off – global workitem space offsets

  • gws – global workitem space

  • lws – local workitem space

  • nparams – number of kernel parameters

  • params – kernel parameters

  • params_off – kernel parameters offset

  • params_info – kernel parameters information

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_kernel_v3(iris_task task, const char *kernel, int dim, size_t *off, size_t *gws, size_t *lws, int nparams, void **params, size_t *params_off, int *params_info, size_t *memranges)

Launches a kernel with parameter offset and memory ranges.

Parameters
  • task – target task

  • kernel – kernel name

  • dim – dimension

  • off – global workitem space offsets

  • gws – global workitem space

  • lws – local workitem space

  • nparams – number of kernel parameters

  • params – kernel parameters

  • params_off – kernel parameters offset

  • params_info – kernel parameters information

  • memranges – sizes of the memory object from the offset

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_kernel_selector(iris_task task, iris_selector_kernel func, void *params, size_t params_size)

passes a kernel selector function for selecting a kernel from a task

Parameters
  • task – target task

  • func – function to select a kernel from task

  • params – kernel parameters

  • params_size – size of the parameters

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_kernel_launch_disabled(iris_task task, int flag)

disable kernel launch from a task

Parameters
  • task – target task

  • flag – bool value, 0: launch enable, 1: launch disable

  • params – kernel parameters

  • params_size – size of the parameters

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_host(iris_task task, iris_host_task func, void *params)

executes a function at the host side

Parameters
  • task – target task

  • func – function to be executed

  • params – kernel parameters

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_custom(iris_task task, int tag, void *params, size_t params_size)

add a custom command to the task which specified registerng a command

Parameters
  • task – target task

  • tag – custom command tag id

  • params – parameters

  • param_size – parameter size

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_submit(iris_task task, int device, const char *opt, int sync)

Submits a task.

Parameters
  • task – target task

  • device – device_selector

  • opt – option string

  • sync – 0: non-blocking, 1: blocking

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_set_policy(iris_task task, int device)

Sets a scheduling policy for a task.

This function sets scheduling policy for a task

Parameters
  • task – iris task object

  • device – device or scheduling policy

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_wait(iris_task task)

Waits for the task to complete.

Parameters

task – target task

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_wait_all(int ntasks, iris_task *tasks)

Waits for all the tasks to complete.

Parameters
  • ntasks – number of tasks

  • tasks – target tasks array

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_add_subtask(iris_task task, iris_task subtask)

Adds a subtask for a task.

This function adds a subtask for a task

Parameters
  • task – iris task object

  • subtask – the subtask that is going to be added

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_kernel_cmd_only(iris_task task)

Retruns whether a task only has kernel command.

This function returns whether a task has only kernel command or not

Parameters

task – iris task object

Returns

returns true if only kernel present in the task otherwise false

int iris_task_release(iris_task task)

Releases a task.

Parameters

task – target task

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_release_mem(iris_task task, iris_mem mem)

Releases memory from a task.

Parameters
  • task – target task

  • mem – memory object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_params_map(iris_task task, int *params_map)

Adds parameter map for a kernel in a task.

Parameters
  • task – target task

  • params_map – parameter map

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_task_info(iris_task task, int param, void *value, size_t *size)

Gets parameter info for a task.

Parameters
  • task – target task

  • params – parameter type

  • value – gets the value

  • size – gets the size

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_register_pin_memory(void *host, size_t size)

Registers pin memory.

This function enables pinning of host memory

Parameters
  • host – host pointer of the data structure

  • size – size of the memory

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_mem_create(size_t size, iris_mem *mem)

Cretes IRIS memory object.

This function creates IRIS memory object for a given size

Parameters
  • size – size of the memory

  • mem – pointer to the memory object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_init_reset(iris_mem mem, int reset)

Resets a memory object by setting the dirty flag for host.

This function resets a memory object by setting the dirty flag for host

Parameters
  • mem – pointer to the memory object

  • reset – 0: no reseting 1: reset

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_create(iris_mem *mem, void *host, size_t size)

Cretes IRIS data memory object.

This function creates IRIS data memory object for a given size

Parameters
  • mem – pointer to the memory object

  • host – host pointer of the data structure

  • size – size of the memory

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_clear(iris_mem mem)

Frees memory for a DMEM object for all the devices.

This function Resets a memory object by setting the dirty flag for host

Parameters

mem – pointer to the memory object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_pin(iris_mem mem)

Pins a host memory for all the available devices.

This function pins a host memory for all the available devices

Parameters

mem – pointer to the memory object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_update(iris_mem mem, void *host)

data memory object update for a task

Parameters
  • mem – memory object

  • host – host pointer to the memory

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_create_region(iris_mem *mem, iris_mem root_mem, int region)

creates data memory region

Parameters
  • mem – pointer to a memory object

  • root_mem – root memory object

  • region – index for the region

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_enable_outer_dim_regions(iris_mem mem)

enable decomposition along the outer dimension

Parameters

mem – memory object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_data_mem_create_tile(iris_mem *mem, void *host, size_t *off, size_t *host_size, size_t *dev_size, size_t elem_size, int dim)

Creates a memory tile from host memory.

Parameters
  • mem – memory object

  • host – host memory pointer

  • off – host memory pointer

  • host_size – indexes to specify sizes from host memory

  • dev_size – indexes to specify sizes from device memory

  • elem_size – element size

  • dim – dimension

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_mem_arch(iris_mem mem, int device, void **arch)

returns the device pointer for a memory object

Parameters
  • mem – iris memory object

  • device – device id

  • arch – device pointer

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_mem_release(iris_mem mem)

releases memory object

Parameters

mem – iris memory object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_create(iris_graph *graph)

Creates a graph.

Parameters

graph – pointer to the graph

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_free(iris_graph graph)

Frees a graph.

Parameters

graph – graph object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_tasks_order(iris_graph brs_graph, int *order)

submits a graph with given order

Parameters
  • graph – graph object

  • order – array of indexes of the tasks in that graph

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_create_json(const char *json, void **params, iris_graph *graph)

Creates json for a graph.

Parameters
  • json – file path to json file

  • params – parameters

  • graph – a pointer to the graph data structure that has the generated graph

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_task(iris_graph graph, iris_task task, int device, const char *opt)

Adds a task to a graph.

Parameters
  • graph – graph object

  • task – task object to be added

  • device – policy/device id

  • opt – optional parameter for custom policy

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_retain(iris_graph graph, bool flag)

Retain a graph object for the next submission.

Parameters
  • graph – graph object

  • flag – 0: not retain, 1:retain

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_release(iris_graph graph)

Releases a graph object.

Parameters

graph – graph object

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_submit(iris_graph graph, int device, int sync)

submits a graph object for execution

Parameters
  • graph – graph object

  • device – policy/device id

  • sync – 0: non-blocking, 1: blocking

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_submit_with_order(iris_graph graph, int *order, int device, int sync)

submits a graph with order defined

Parameters
  • graph – graph object

  • order – array of task index specifying the order

  • device – policy/device id

  • sync – 0: non-blocking, 1: blocking

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_submit_with_order_and_time(iris_graph graph, int *order, double *time, int device, int sync)

submits a graph with order defined and it returns the time

Parameters
  • graph – graph object

  • order – array of task index specifying the order

  • time – Time pointer, in which the graph execution time is returned

  • device – policy/device id

  • sync – 0: non-blocking, 1: blocking

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int iris_graph_submit_with_time(iris_graph graph, double *time, int device, int sync)

Submit the IRIS graph and returns the time along with state.

Parameters
  • graph – iris_graph (IRIS Graph) object

  • time – Time pointer, in which the graph execution time is returned

  • device – IRIS device selection policy

  • sync – 0: non-blocking, 1: blocking

Returns

This functions return an error value. IRIS_SUCCESS, IRIS_ERROR

int iris_graph_wait(iris_graph graph)

Wait for the completion of IRIS graph.

Parameters

graphs – iris_graph (IRIS Graph) object

Returns

This functions return an error value. IRIS_SUCCESS, IRIS_ERROR

int iris_graph_wait_all(int ngraphs, iris_graph *graphs)

Wait for the completion of all array of IRIS graphs.

Parameters
  • ngraphs – Number of graphs

  • graphs – Array of iris_graph (IRIS Graph) objects

Returns

This functions return an error value. IRIS_SUCCESS, IRIS_ERROR

int iris_record_start()

Start recording task graph to generate JSON graph.

Returns

This functions return an error value. IRIS_SUCCESS, IRIS_ERROR

int iris_record_stop()

Stop recording task graph to generate JSON graph.

Returns

This functions return an error value. IRIS_SUCCESS, IRIS_ERROR

int iris_timer_now(double *time)

Returns current time in seconds.

Returns current time in seconds.

Parameters

time – pointer of time

Returns

This function returns current time.

void iris_enable_d2d()

Enables peer to peer transfer.

This function enables peer to peer transfer

void iris_disable_d2d()

Disables peer to peer transfer.

This function disables peer to peer transfer

char *iris_kernel_get_name(iris_kernel brs_kernel)

Returns a kernel name.

This function returns a kernel name

Parameters

brs_kernel – kernel object

Returns

This function returns name of the kernel.

char *iris_task_get_name(iris_task brs_task)

Retruns a task name.

This function returns a task name

Parameters

brs_task – task object

Returns

This function returns name of the task.

void iris_task_set_name(iris_task brs_task, const char *name)

Sets a task name.

This function Sets a task name

Parameters
  • brs_task – task object

  • name – name of the task

int iris_task_get_dependency_count(iris_task brs_task)

Gets dependency counts for a task.

This function returns dependency count for a task

Parameters

brs_task – task object

Returns

This function returns dependency count for a task

void iris_task_get_dependencies(iris_task brs_task, iris_task *tasks)

Gets all the dependent tasks for a given task.

This function provide all the dependent tasks for a given task

Parameters
  • brs_task – task object

  • task – a list of dependent task for brs_task

unsigned long iris_task_get_uid(iris_task brs_task)

Gets unique ID for a task.

This function provides IRIS generated unique ID for a given task object

Parameters

brs_task – task object

Returns

This function returns the unique id

unsigned long iris_kernel_get_uid(iris_kernel brs_kernel)

Gets unique ID for a kernel.

This function provides IRIS generated unique ID for a given kernel object

Parameters

brs_kernel – kernel object

Returns

This function returns the unique id for the kernel

size_t iris_count_mems(iris_graph brs_graph)

Count number of memory objects used in the IRIS graph.

Parameters

brs_graph – IRIS graph object

Returns

return number of memory objects used in iris_graph

void iris_free_array(void *ptr)

Free memory location using IRIS api.

Parameters

ptr – Input pointer of the object

int8_t *iris_allocate_array_int8_t(int SIZE, int8_t init)

Mallocs int8_t type array for a given size with a given initial value.

This function mallocs int8_t type array for a given size with a given initial value

Parameters
  • SIZE – size of the array

  • init – initialization value

Returns

This function returns the pointer to the newly allocated array

int16_t *iris_allocate_array_int16_t(int SIZE, int16_t init)

Mallocs int16_t type array for a given size with a given initial value.

This function mallocs int16_t type array for a given size with a given initial value

Parameters
  • SIZE – size of the array

  • init – initialization value

Returns

This function returns the pointer to the newly allocated array

int32_t *iris_allocate_array_int32_t(int SIZE, int32_t init)

Mallocs int32_t type array for a given size with a given initial value.

This function mallocs int32_t type array for a given size with a given initial value

Parameters
  • SIZE – size of the array

  • init – initialization value

Returns

This function returns the pointer to the newly allocated array

int64_t *iris_allocate_array_int64_t(int SIZE, int64_t init)

Mallocs int64_t type array for a given size with a given initial value.

This function mallocs int64_t type array for a given size with a given initial value

Parameters
  • SIZE – size of the array

  • init – initialization value

Returns

This function returns the pointer to the newly allocated array

size_t *iris_allocate_array_size_t(int SIZE, size_t init)

Mallocs size_t type array for a given size with a given initial value.

This function mallocs size_t type array for a given size with a given initial value

Parameters
  • SIZE – size of the array

  • init – initialization value

Returns

This function returns the pointer to the newly allocated array

float *iris_allocate_array_float(int SIZE, float init)

Mallocs float type array for a given size with a given initial value.

This function mallocs float type array for a given size with a given initial value

Parameters
  • SIZE – size of the array

  • init – initialization value

Returns

This function returns the pointer to the newly allocated array

double *iris_allocate_array_double(int SIZE, double init)

Mallocs double type array for a given size with a given initial value.

This function mallocs double type array for a given size with a given initial value

Parameters
  • SIZE – size of the array

  • init – initialization value

Returns

This function returns the pointer to the newly allocated array

int8_t *iris_allocate_random_array_int8_t(int SIZE)

Mallocs int8_t type array for a given size with a random value.

This function mallocs int8_t type array for a given size with a random value

Parameters

SIZE – size of the array

Returns

This function returns the pointer to the newly allocated array

int16_t *iris_allocate_random_array_int16_t(int SIZE)

Mallocs int16_t type array for a given size with a random value.

This function mallocs int16_t type array for a given size with a random value

Parameters

SIZE – size of the array

Returns

This function returns the pointer to the newly allocated array

int32_t *iris_allocate_random_array_int32_t(int SIZE)

Mallocs int32_t type array for a given size with a random value.

This function mallocs int32_t type array for a given size with a random value

Parameters

SIZE – size of the array

Returns

This function returns the pointer to the newly allocated array

int64_t *iris_allocate_random_array_int64_t(int SIZE)

Mallocs int64_t type array for a given size with a random value.

This function mallocs int64_t type array for a given size with a random value

Parameters

SIZE – size of the array

Returns

This function returns the pointer to the newly allocated array

size_t *iris_allocate_random_array_size_t(int SIZE)

Mallocs size_t type array for a given size with a random value.

This function mallocs size_t type array for a given size with a random value

Parameters

SIZE – size of the array

Returns

This function returns the pointer to the newly allocated array

float *iris_allocate_random_array_float(int SIZE)

Mallocs float type array for a given size with a random value.

This function mallocs float type array for a given size with a random value

Parameters

SIZE – size of the array

Returns

This function returns the pointer to the newly allocated array

double *iris_allocate_random_array_double(int SIZE)

Mallocs double type array for a given size with a random value.

This function mallocs double type array for a given size with a random value

Parameters

SIZE – size of the array

Returns

This function returns the pointer to the newly allocated array

void iris_print_matrix_full_double(double *data, int M, int N, const char *description)

Prints a full matrix data structure of double type.

This function prints a full matrix data structure of double type of M rows and N columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

void iris_print_matrix_limited_double(double *data, int M, int N, const char *description, int limit)

Prints a matrix data structure of double type for a given limit of rows and columns.

This function prints a matrix data structure of double type for limited rows and columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

  • limit – printing limit for rows and columns

void iris_print_matrix_full_float(float *data, int M, int N, const char *description)

Prints a full matrix data structure of float type.

This function prints a full matrix data structure of float type of M rows and N columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

void iris_print_matrix_limited_float(float *data, int M, int N, const char *description, int limit)

Prints a matrix data structure of float type for a given limit of rows and columns.

This function prints a matrix data structure of float type for limited rows and columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

  • limit – printing limit for rows and columns

void iris_print_matrix_full_int64_t(int64_t *data, int M, int N, const char *description)

Prints a full matrix data structure of int64_t type.

This function prints a full matrix data structure of int64_t type of M rows and N columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

void iris_print_matrix_limited_int64_t(int64_t *data, int M, int N, const char *description, int limit)

Prints a matrix data structure of int64_t type for a given limit of rows and columns.

This function prints a matrix data structure of int64_t type for limited rows and columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

  • limit – printing limit for rows and columns

void iris_print_matrix_full_int32_t(int32_t *data, int M, int N, const char *description)

Prints a full matrix data structure of int32_t type.

This function prints a full matrix data structure of int32_t type of M rows and N columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

void iris_print_matrix_limited_int32_t(int32_t *data, int M, int N, const char *description, int limit)

Prints a matrix data structure of int32_t type for a given limit of rows and columns.

This function prints a matrix data structure of int32_t type for limited rows and columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

  • limit – printing limit for rows and columns

void iris_print_matrix_full_int16_t(int16_t *data, int M, int N, const char *description)

Prints a full matrix data structure of int16_t type.

This function prints a full matrix data structure of int16_t type of M rows and N columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

void iris_print_matrix_limited_int16_t(int16_t *data, int M, int N, const char *description, int limit)

Prints a matrix data structure of int16_t type for a given limit of rows and columns.

This function prints a matrix data structure of int16_t type for limited rows and columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

  • limit – printing limit for rows and columns

void iris_print_matrix_full_int8_t(int8_t *data, int M, int N, const char *description)

Prints a full matrix data structure of int8_t type.

This function prints a full matrix data structure of int8_t type of M rows and N columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

void iris_print_matrix_limited_int8_t(int8_t *data, int M, int N, const char *description, int limit)

Prints a matrix data structure of int8_t type for a given limit of rows and columns.

This function prints a matrix data structure of int8_t type for limited rows and columns with a provided description

Parameters
  • data – pointer to the matrix

  • M – rows of the matrix

  • N – columns of the matrix

  • description – input string for description

  • limit – printing limit for rows and columns

struct _iris_task

Public Members

void *class_obj
unsigned long uid
struct _iris_kernel

Public Members

void *class_obj
unsigned long uid
struct _iris_mem

Public Members

void *class_obj
unsigned long uid
struct _iris_graph

Public Members

void *class_obj
unsigned long uid

C++ API

Defines

iris_mem_type
iris_task_type
namespace iris
class BaseMem
#include <iris.hpp>

BaseMem Class for IRIS memory objects. It is a base class IRIS memory objects

Subclassed by iris::DMem, iris::DMemRegion, iris::Mem

Public Functions

inline BaseMem()

BaseMem Classs constructor.

inline virtual ~BaseMem()

BaseMem Classs destructor.

inline iris_mem_type mem()

get C structure IRIS memory object

Returns

C structure IRIS memory object

inline iris_mem_type *mem_ptr()

get C structure IRIS memory object pointer

Returns

C structure IRIS memory object pointer

Protected Attributes

iris_mem_type mem_
class DMem : public iris::BaseMem
#include <iris.hpp>

DMem class for IRIS (Novel data memory) memory objects. It is a derived from the BaseMem class

Public Functions

DMem(void *host, size_t size)

DMem Classs constructor.

Creates IRIS data memory object for a given size

Parameters
  • host – host pointer of the data structure

  • size – size of the memory

DMem(void *host, size_t *off, size_t *host_size, size_t *dev_size, size_t elem_size, int dim)

DMem Classs constructor.

Parameters
  • host – host memory pointer

  • off – host memory pointer

  • host_size – indexes to specify sizes from host memory

  • dev_size – indexes to specify sizes from device memory

  • elem_size – element size

  • dim – dimension

virtual ~DMem()

DMem Classs destructor.

int update(void *host)

Update DMem object with new host memory pointer.

Parameters

host – host memory pointer

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int reset(bool reset)

Update DMem object with new host memory pointer.

Parameters

reset – the data memory object and all its internal dirty bit flags

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

int enable_outer_dim_regions()

enable decomposition along the outer dimension

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

class DMemRegion : public iris::BaseMem

Public Functions

DMemRegion(iris_mem_type root_mem, int region)
DMemRegion(DMem *root_mem, int region)
inline virtual ~DMemRegion()
inline DMem *parent()

Private Members

DMem *dmem_
class Graph

Public Functions

Graph(bool retainable = false)
virtual ~Graph()
void retainable()
int add_task(Task &task, int device, const char *opt = NULL)
int set_order(int *order)
int submit(int device, int sync = false)
int wait()
int release()
inline iris_graph graph()

Private Members

bool retainable_
bool is_released_
iris_graph graph_
class Mem : public iris::BaseMem
#include <iris.hpp>

Mem class for IRIS classic memory objects. It is a derived from the BaseMem class

Public Functions

Mem(size_t size)

Mem Classs constructor.

virtual ~Mem()

Mem Classs destructor.

class Platform
#include <iris.hpp>

IRIS Platform Class for application

Public Functions

inline Platform()

Platform Classs constructor.

inline ~Platform()

Platform Classs destructor.

inline int init(int *argc, char ***argv, bool sync = false)

Initialize IRIS platform.

Parameters
  • argc – pointer to the number of arguments

  • argv – argument array

  • sync – 0: non-blocking, 1: blocking

Returns

This functions return an error value. IRIS_SUCCESS, IRIS_ERROR

inline int finalize()

Terminates the IRIS platform .

this funciton put end to IRIS execution environment.

Returns

This function returns an integer indicating IRIS_SUCCESS or IRIS_ERROR .

inline int error_count()

Return number of errors occurred in IRIS.

Returns

This function returns the number of errors

Private Members

bool finalized_
class Task

Public Functions

Task(const char *name = NULL, bool perm = false, bool retainable = false)
inline virtual ~Task()
int set_order(int *order)
int h2d(Mem *mem, size_t off, size_t size, void *host)
int h2d_full(Mem *mem, void *host)
int h2broadcast(Mem *mem, size_t off, size_t size, void *host)
int h2broadcast_full(Mem *mem, void *host)
int d2h(Mem *mem, size_t off, size_t size, void *host)
int d2h_full(Mem *mem, void *host)
int flush_out(DMem &mem)
int kernel(const char *kernel, int dim, size_t *off, size_t *gws, size_t *lws, int nparams, void **params, int *params_info)
int submit(int device, const char *opt, bool sync)
void depends_on(int ntasks, Task **tasks)
void depends_on(std::vector<Task*> tasks)
void depends_on(Task &task)
inline void disable_launch()
inline iris_task_type task()

Private Members

iris_task_type task_
bool retainable_

Fortran API

namespace iris

Functions

subroutine iris_init(SYNC, IERROR)
subroutine iris_finalize(IERROR)
subroutine iris_mem_create(SIZE, MEM, IERROR)
subroutine iris_task_create(TASK, IERROR)
subroutine iris_task_h2d_full(TASK, MEM, HOST, IERROR)
subroutine iris_task_d2h_full(TASK, MEM, HOST, IERROR)
subroutine iris_task_kernel(TASK, KERNEL, DIM, OFF, GWS, LWS, NPARAMS, PARAMS, PARAMS_INFO, IERROR)
subroutine iris_task_submit(TASK, DEV, SYNC, IERROR)

Variables

integer, parameter iris_success   = 0
integer, parameter iris_error   = -1
integer, parameter iris_cpu   = LSHIFT(1, 6)
integer, parameter iris_nvidia   = LSHIFT(1, 7)
integer, parameter iris_amd   = LSHIFT(1, 8)
integer, parameter iris_gpu   = IRIS_NVIDIA + IRIS_AMD
integer, parameter iris_r   = -1
integer, parameter iris_w   = -2
integer, parameter iris_rw   = -3
interface IRIS_FINALIZE_CBIND

Public Functions

integer(c_int) function iris_finalize_cbind ()
interface IRIS_INIT_CBIND

Public Functions

integer(c_int) function iris_init_cbind (ARGC, ARGV, SYNC)
interface IRIS_MEM_CREATE_CBIND

Public Functions

integer(c_int) function iris_mem_create_cbind (SIZE, MEM)
interface IRIS_TASK_CREATE_CBIND

Public Functions

integer(c_int) function iris_task_create_cbind (TASK)
interface IRIS_TASK_D2H_FULL_CBIND

Public Functions

integer(c_int) function iris_task_d2h_full_cbind (TASK, MEM, HOST)
interface IRIS_TASK_H2D_FULL_CBIND

Public Functions

integer(c_int) function iris_task_h2d_full_cbind (TASK, MEM, HOST)
interface IRIS_TASK_KERNEL_CBIND

Public Functions

integer(c_int) function iris_task_kernel_cbind (TASK, KERNEL, DIM, OFF, GWS, LWS, NPARAMS, PARAMS, PARAMS_INFO)
interface IRIS_TASK_SUBMIT_CBIND

Public Functions

integer(c_int) function iris_task_submit_cbind (TASK, DEV, OPT, SYNC)

Python API

class iris.CommData3D[source]
class iris.DataObjectProfile[source]
class iris.IRIS[source]
class iris.TaskProfile[source]
class iris.iris_graph[source]
class iris.iris_kernel[source]
class iris.iris_mem[source]
class iris.iris_task[source]
class iris.library(library_name, read_symbols=False)[source]