Struct ExecutionOptions

Struct Documentation

struct ExecutionOptions

Manages execution options, including CUDA stream configuration, storage type selection, and the behavior regarding initial data location.

Public Functions

inline ExecutionOptions &set_stream(cudaStream_t stream)

Sets the CUDA stream to be used for execution.

This method allows you to specify the CUDA stream that will be used during the execution of operations. By default, the stream is set to cudaStreamDefault.

Parameters:

stream – The CUDA stream to set.

Returns:

ExecutionOptions& A reference to the updated ExecutionOptions object, allowing method chaining.

inline ExecutionOptions &set_storage_type(storage_type storage)

Configures the storage type for execution.

Sets the storage type where the operation’s data will be stored. This can typically be either storage_type::DEVICE or storage_type::HOST.

Parameters:

storage – The storage type to set (e.g., DEVICE or HOST).

Returns:

ExecutionOptions& A reference to the updated ExecutionOptions object, allowing method chaining.

inline ExecutionOptions &set_initial_location(bool keep_initial_condition)

Specifies whether to preserve the initial data location.

Controls whether the initial data location (e.g., host or device) is preserved during execution. If set to true, the data will be returned to its initial location after the operation.

Parameters:

keep_initial_condition – Boolean flag to determine whether to keep the initial location.

Returns:

ExecutionOptions& A reference to the updated ExecutionOptions object, allowing method chaining.

Public Members

cudaStream_t stream_ = cudaStreamDefault
storage_type storage_ = storage_type::DEVICE
bool keep_initial_condition_ = true