Skip to main content

cutensorCreatePlan

Function cutensorCreatePlan 

Source
pub unsafe extern "C" fn cutensorCreatePlan(
    handle: cutensorHandle_t,
    plan: *mut cutensorPlan_t,
    desc: cutensorOperationDescriptor_t,
    pref: cutensorPlanPreference_t,
    workspaceSizeLimit: u64,
) -> cutensorStatus_t
Expand description

This function allocates a cutensorPlan_t object, selects an appropriate kernel for a given operation (encoded by desc) and prepares a plan that encodes the execution.

This function applies cuTENSOR’s heuristic to select a candidate/kernel for a given operation (created by either cutensorCreateContraction, cutensorCreateReduction, cutensorCreatePermutation, cutensorCreateElementwiseBinary, cutensorCreateElementwiseTrinary, cutensorCreateContractionTrinary, or cutensorCreateBlockSparseContraction). The created plan can then be passed to either cutensorContract, cutensorReduce, cutensorPermute, cutensorElementwiseBinaryExecute, cutensorElementwiseTrinaryExecute, or cutensorContractTrinary to perform the actual operation.

The plan is created for the active CUDA device.

Note: cutensorCreatePlan must not be captured via CUDA graphs if Just-In-Time compilation is enabled (i.e., cutensorJitMode_t is not cutensorJitMode_t::CUTENSOR_JIT_MODE_NONE).

§Parameters

§Return value