set_mode¶
Sets a new mode for VM functions according to the mode
parameter and
returns the previous VM mode.
Description¶
The set_mode
function sets a new mode for VM functions according to the new_mode
parameter and returns the previous VM mode. The mode change has a global effect on all the VM functions within a queue.
oneMKL VM mode parameters provide control on the accuracy of mathematical functions, and on oneMKL VM Strided API behavior. The mode set for a given queue can be overridden locally by the local mode parameter in a VM function call.
The mode value is a bitwise OR (|) combination of the values described in the following table.
Value |
Description |
---|---|
Accuracy Control |
|
|
High accuracy versions of VM functions. (DEFAULT) |
|
Low accuracy versions of VM functions. |
|
Enhanced performance accuracy versions of VM functions. |
Slice Argument Checking |
|
|
Throw a |
|
Invalid arguments quietly make the call a “no-op”. The VM status is set to |
Slice Indexing Controls |
|
|
Non-equal slice sizes are considered invalid. (DEFAULT) |
|
The minimum of all slice sizes defines the number of evaluations. |
|
The output slice(s) size defines the number of evaluations. Input slices wrap around from the start. |
Default Local Mode |
|
|
VM mode not defined. This has no effect. |
The default value if no VM mode is defined or if the VM mode value is set to mode::not_defined
is (mode::badarg_exception
| mode::slice_normal
| mode::ha
).
API¶
Syntax¶
uint64_t set_mode(queue& exec_queue, uint64_t new_mode )
set_mode
supports the following devices: Host, CPU, and GPU.
Input Parameters¶
- exec_queue
The queue where the routine should be executed.
- new_mode
Specifies the VM mode to be set.
Output Parameters¶
- return value (old_mode)
Specifies the former VM mode.
Examples¶
oldmode = set_mode (exec_queue , mode::la);
oldmode = set_mode (exec_queue , mode::ep | mode::ftzdazon);