Skip to main content

cutensorMgContractionGetWorkspace

Function cutensorMgContractionGetWorkspace 

Source
pub unsafe extern "C" fn cutensorMgContractionGetWorkspace(
    handle: cutensorMgHandle_t,
    desc: cutensorMgContractionDescriptor_t,
    find: cutensorMgContractionFind_t,
    preference: cutensorWorksizePreference_t,
    deviceWorkspaceSize: *mut i64,
    hostWorkspaceSize: *mut i64,
) -> cutensorStatus_t
Expand description

Computes the workspace that is needed for the contraction.

The function calculates the workspace required for the contraction operation to succeed. It takes a workspace preference, which can tune how much workspace is needed. It returns the device workspace size in the same order as the devices are passed to the library handle.

Remark

non-blocking, no reentrant, and thread-safe.

§Parameters

  • handle: The library handle.
  • desc: The contraction descriptor.
  • find: The contraction find.
  • preference: The workspace preference.
  • deviceWorkspaceSize: The amount of workspace in bytes, for each device in the handle.
  • hostWorkspaceSize: The amount of pinned host memory in bytes.

§Return value