create_plan#

nvmath.bindings.cutensor.create_plan(
intptr_t handle,
intptr_t desc,
intptr_t pref,
uint64_t workspace_size_limit,
) intptr_t[source]#

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.

Parameters:
  • handle (intptr_t) – Opaque handle holding cuTENSOR’s library context.

  • desc (intptr_t) – This opaque struct encodes the given operation (see cutensorCreateContraction, cutensorCreateReduction, cutensorCreatePermutation, cutensorCreateElementwiseBinary, cutensorCreateElementwiseTrinary, or cutensorCreateContractionTrinary).

  • pref (intptr_t) – This opaque struct is used to restrict the space of applicable candidates/kernels (see cutensorCreatePlanPreference or cutensorPlanPreferenceAttribute_t). May be nullptr, in that case default choices are assumed. Block-sparse contractions currently only support these default settings and ignore other supplied preferences.

  • workspace_size_limit (uint64_t) – Denotes the maximal workspace that the corresponding operation is allowed to use (see cutensorEstimateWorkspaceSize).

Returns:

Pointer to the data structure created by this function that holds all information (e.g., selected kernel) necessary to perform the desired operation.

Return type:

intptr_t

See also

cutensorCreatePlan