set_mode

set_mode#

Sets a new mode for VM functions according to the mode parameter and returns the previous VM mode.

Syntax

namespace oneapi::math::vm {

    oneapi::math::vm::mode set_mode(
        sycl::queue& exec_queue,
        oneapi::math::vm::mode new_mode);

} // namespace oneapi::math::vm

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.

The mode parameter is designed to control accuracy for a given queue.

Value of mode

Description

Accuracy Control

oneapi::math::vm::mode::ha

High accuracy versions of VM functions.

oneapi::math::vm::mode::la

Low accuracy versions of VM functions.

oneapi::math::vm::mode::ep

Enhanced performance accuracy versions of VM functions.

oneapi::math::vm::mode::not_defined

VM mode not defined. This has no effect.

The assumed value of the mode parameter for a new queue, if set_mode is not called is oneapi::math::vm::mode::ha.

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.