_GFX_enqueue

Puts the task into the in-order offload queue. This topic only applies to Intel® 64 and IA-32 architectures targeting Intel® Graphics Technology.

Syntax

GfxTaskId _GFX_enqueue(const char * kernel_name, arg_list);

Parameters

kernel_name

The name of a kernel. A string matching the unmangled name of the kernel entry function.

arg_list

The argument list for the kernel as variable argument list. The list must match the kernel parameter list. The runtime knows which arguments to expect from kernel attributes.

Description

This function performs all necessary operations to put an offload task into the queue. Specify the kernel using the given kernel entry function name. This function passes the parameters to the kernel entry function, with necessary preparation operations for some special data types, such as 2D images or pointers.

No extra general runtime initialization is necessary. The function performs all necessary initialization operations if they are not already done earlier.

This function is non-blocking. It does not wait for the completion of incoming tasks.

Dispatching and task splitting between the CPU and the processor graphics is not in the scope of this function, so you should organize these explicitly. The compiler assists you by generating host and target versions for all target functions, including the kernel entry function, and by providing compatible semantics for _Cilk_for loops in the kernel entry point.

The Intel® Graphics Technology runtime maintains only one default queue, for simplicity.

Use the _GFX_wait function wait for completion of a task that _GFX_enqueue created and enqueued.

This function is thread safe; it can be accessed from different host threads without extra synchronization effort on your part.

Return Values

task id

The task id for the enqueued offload task. You can pass this value to _GFX_wait to wait for task completion. The task id is an incremental 64 bit integer value assigned to each new task. It provides for safe usage in multithreaded environment, without relying on the user to explicitly close and destroy each enqueued task.

0

An error has occurred. Use the function _GFX_get_last_error() to get the specific error code.

For more complete information about compiler optimizations, see our Optimization Notice.