cuTENSOR (nvmath.bindings.cutensor)#

For detailed documentation on the original C APIs, refer to the cuTENSOR documentation.

Enums and constants#

ComputeDesc()

See cutensorComputeDescriptor_t.

cuTENSORError(status)

Operator(value)

This enum captures all unary and binary element-wise operations supported by the cuTENSOR library.

Status(value)

cuTENSOR status type returnsThe type is used for function status returns.

Algo(value)

Allows users to specify the algorithm to be used for performing the desired tensor operation.

WorksizePreference(value)

This enum gives users finer control over the suggested workspace.This enum gives users finer control over the amount of workspace that is suggested by cutensorEstimateWorkspaceSize

OperationDescriptorAttribute(value)

This enum lists all attributes of a cutensorOperationDescriptor_t that can be modified (see cutensorOperationDescriptorSetAttribute and cutensorOperationDescriptorGetAttribute).

PlanPreferenceAttribute(value)

This enum lists all attributes of a cutensorPlanPreference_t object that can be modified.

AutotuneMode(value)

This enum determines the mode w.r.t.

JitMode(value)

This enum determines the mode w.r.t.

CacheMode(value)

This enum defines what is considered a cache hit.

PlanAttribute(value)

This enum lists all attributes of a cutensorPlan_t object that can be retrieved via cutensorPlanGetAttribute.

Functions#

create()

Initializes the cuTENSOR library and allocates the memory for the library context.

destroy(intptr_t handle)

Frees all resources related to the provided library handle.

handle_resize_plan_cache(intptr_t handle, ...)

Resizes the plan cache.

handle_write_plan_cache_to_file(...)

Writes the Plan-Cache (that belongs to the provided handle) to file.

handle_read_plan_cache_from_file(...)

Reads a Plan-Cache from file and overwrites the cachelines of the provided handle.

write_kernel_cache_to_file(intptr_t handle, ...)

Writes the --per library-- kernel cache to file.

read_kernel_cache_from_file(intptr_t handle, ...)

Reads a kernel cache from file and adds all non-existing JIT compiled kernels to the kernel cache.

create_tensor_descriptor(intptr_t handle, ...)

Creates a tensor descriptor.

destroy_tensor_descriptor(intptr_t desc)

Frees all resources related to the provided tensor descriptor.

create_elementwise_trinary(intptr_t handle, ...)

This function creates an operation descriptor that encodes an elementwise trinary operation.

elementwise_trinary_execute(intptr_t handle, ...)

Performs an element-wise tensor operation for three input tensors (see cutensorcreateElementwiseTrinary).

create_elementwise_binary(intptr_t handle, ...)

This function creates an operation descriptor for an elementwise binary operation.

elementwise_binary_execute(intptr_t handle, ...)

Performs an element-wise tensor operation for two input tensors (see cutensorcreateElementwiseBinary).

create_permutation(intptr_t handle, ...)

This function creates an operation descriptor for a tensor permutation.

permute(intptr_t handle, intptr_t plan, ...)

Performs the tensor permutation that is encoded by plan (see cutensorCreatePermutation).

create_contraction(intptr_t handle, ...)

This function allocates a cutensorOperationDescriptor_t object that encodes a tensor contraction of the form .

destroy_operation_descriptor(intptr_t desc)

Frees all resources related to the provided descriptor.

get_operation_descriptor_attribute_dtype(...)

Get the Python data type of the corresponding OperationDescriptorAttribute attribute.

operation_descriptor_set_attribute(...)

Set attribute of a cutensorOperationDescriptor_t object.

operation_descriptor_get_attribute(...)

This function retrieves an attribute of the provided cutensorOperationDescriptor_t object (see cutensorOperationDescriptorAttribute_t).

create_plan_preference(intptr_t handle, ...)

Allocates the cutensorPlanPreference_t, enabling users to limit the applicable kernels for a given plan/operation.

destroy_plan_preference(intptr_t pref)

Frees all resources related to the provided preference.

get_plan_preference_attribute_dtype(int attr)

Get the Python data type of the corresponding PlanPreferenceAttribute attribute.

plan_preference_set_attribute(...)

Set attribute of a cutensorPlanPreference_t object.

plan_preference_get_attribute(...)

Get attribute of a cutensorPlanPreference_t object.

get_plan_attribute_dtype(int attr)

Get the Python data type of the corresponding PlanAttribute attribute.

plan_get_attribute(intptr_t handle, ...)

Retrieves information about an already-created plan (see cutensorPlanAttribute_t).

estimate_workspace_size(intptr_t handle, ...)

Determines the required workspaceSize for the given operation encoded by desc.

create_plan(intptr_t handle, intptr_t desc, ...)

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.

destroy_plan(intptr_t plan)

Frees all resources related to the provided plan.

contract(intptr_t handle, intptr_t plan, ...)

This routine computes the tensor contraction .

create_reduction(intptr_t handle, ...)

Creates a cutensorOperatorDescriptor_t object that encodes a tensor reduction of the form .

reduce(intptr_t handle, intptr_t plan, ...)

Performs the tensor reduction that is encoded by plan (see cutensorcreateReduction).

create_contraction_trinary(intptr_t handle, ...)

This function allocates a cutensorOperationDescriptor_t object that encodes a tensor contraction of the form .

contract_trinary(intptr_t handle, ...)

This routine computes the tensor contraction .

create_block_sparse_tensor_descriptor(...)

Create a block-sparse tensor descriptor.

destroy_block_sparse_tensor_descriptor(...)

Frees all resources related to the provided block-sparse tensor descriptor.

create_block_sparse_contraction(...)

This function allocates a cutensorOperationDescriptor_t object that encodes a block-sparse tensor contraction of the form .

block_sparse_contract(intptr_t handle, ...)

This routine computes the block-sparse tensor contraction .

get_error_string(int error)

Returns the description string for an error code.

get_version()

Returns Version number of the CUTENSOR library.

get_cudart_version()

Returns version number of the CUDA runtime that cuTENSOR was compiled against.

logger_set_file(intptr_t file)

This function sets the logging output file.

logger_open_file(log_file)

This function opens a logging output file in the given path.

logger_set_level(int32_t level)

This function sets the value of the logging level.

logger_set_mask(int32_t mask)

This function sets the value of the log mask.

logger_force_disable()

This function disables logging for the entire run.