Skip to main content

cuTensorMapEncodeIm2colWide

Function cuTensorMapEncodeIm2colWide 

Source
pub unsafe extern "C" fn cuTensorMapEncodeIm2colWide(
    tensorMap: *mut CUtensorMap,
    tensorDataType: CUtensorMapDataType,
    tensorRank: cuuint32_t,
    globalAddress: *mut c_void,
    globalDim: *const cuuint64_t,
    globalStrides: *const cuuint64_t,
    pixelBoxLowerCornerWidth: c_int,
    pixelBoxUpperCornerWidth: c_int,
    channelsPerPixel: cuuint32_t,
    pixelsPerColumn: cuuint32_t,
    elementStrides: *const cuuint32_t,
    interleave: CUtensorMapInterleave,
    mode: CUtensorMapIm2ColWideMode,
    swizzle: CUtensorMapSwizzle,
    l2Promotion: CUtensorMapL2promotion,
    oobFill: CUtensorMapFloatOOBfill,
) -> CUresult
Expand description

Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension.

Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a im2col memory layout and where the row is always loaded along the W dimensuin and returns it in tensorMap. This assumes the tensor layout in memory is either NDHWC, NHWC, or NWC.

This API is only supported on devices of compute capability 10.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX.

The parameters passed are bound to the following requirements:

globalDim array, which specifies tensor size of each of the tensorRank dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for the packed data types:

globalStrides array, which specifies tensor stride of each of the lower tensorRank - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be met:

pixelBoxLowerCornerWidth specifies the coordinate offset W of the bounding box from left corner. The offset must be within range [-32768, 32767].

The bounding box specified by pixelBoxLowerCornerWidth and pixelBoxUpperCornerWidth must have non-zero area. Note that the size of the box along D and H dimensions is always equal to one.

Additionally, ::CU_TENSOR_MAP_SWIZZLE_96B is supported only when mode is CUtensorMapIm2ColWideMode::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W.

ยงParameters

  • tensorMap: Tensor map object to create.
  • tensorDataType: Tensor data type.
  • tensorRank: Dimensionality of tensor; must be at least 3.
  • globalAddress: Starting address of memory region described by tensor.
  • globalDim: Array containing tensor size (number of elements) along each of the tensorRank dimensions.
  • globalStrides: Array containing stride size (in bytes) along each of the tensorRank - 1 dimensions.
  • pixelBoxLowerCornerWidth: Width offset of left box corner.
  • pixelBoxUpperCornerWidth: Width offset of right box corner.
  • channelsPerPixel: Number of channels per pixel.
  • pixelsPerColumn: Number of pixels per column.
  • elementStrides: Array containing traversal stride in each of the tensorRank dimensions.
  • interleave: Type of interleaved layout the tensor addresses.
  • mode: W or W128 mode.
  • swizzle: Bank swizzling pattern inside shared memory.
  • l2Promotion: L2 promotion size.
  • oobFill: Indicate whether zero or special NaN constant will be used to fill out-of-bound elements.