Skip to main content

cutensorMgContraction

Function cutensorMgContraction 

Source
pub unsafe extern "C" fn cutensorMgContraction(
    handle: cutensorMgHandle_t,
    plan: cutensorMgContractionPlan_t,
    alpha: *const c_void,
    ptrA: *mut *const c_void,
    ptrB: *mut *const c_void,
    beta: *const c_void,
    ptrC: *mut *const c_void,
    ptrD: *mut *mut c_void,
    deviceWorkspace: *mut *mut c_void,
    hostWorkspace: *mut c_void,
    streams: *mut cudaStream_t,
) -> cutensorStatus_t
Expand description

Execute a contraction operation.

Executes a contraction operation according to the provided plan. It receives all the operands as arrays of pointers that are ordered according to their tensor descriptors’ devices parameter. The device workspace and streams are ordered according to the library handle’s devices parameter. The function is thread safe as long as concurrent threads use different library handles.

Remark

calls asynchronous functions, non-blocking, no reentrant, and conditionally thread-safe.

§Parameters

  • handle: The library handle.
  • plan: The copy plan.
  • alpha: The alpha scaling factor (host pointer).
  • ptrA: The A operand tensor pointers.
  • ptrB: The B operand tensor pointers.
  • beta: The beta scaling factor (host pointer).
  • ptrC: The operand C tensor pointers.
  • ptrD: The operand D tensor pointers.
  • deviceWorkspace: The device workspace.
  • hostWorkspace: The host pinned memory workspace.
  • streams: The execution streams.

§Return value