cupy.cuda.texture.ResourceDescriptor#

class cupy.cuda.texture.ResourceDescriptor(int restype, CUDAarray cuArr=None, ndarray arr=None, ChannelFormatDescriptor chDesc=None, size_t sizeInBytes=0, size_t width=0, size_t height=0, size_t pitchInBytes=0)[source]#

一个存储资源描述的类。等同于 cudaResourceDesc

参数:
  • restype (int) – 资源类型。使用 cudaResourceType* 中的值,例如 cupy.cuda.runtime.cudaResourceTypeArray

  • cuArr (CUDAarray, 可选) – CUDAarray 的一个实例,如果 restype 设置为 cupy.cuda.runtime.cudaResourceTypeArray,则必需。

  • arr (cupy.ndarray, 可选) – ndarray 的一个实例,如果 restype 设置为 cupy.cuda.runtime.cudaResourceTypeLinearcupy.cuda.runtime.cudaResourceTypePitch2D,则必需。

  • chDesc (ChannelFormatDescriptor, 可选) – ChannelFormatDescriptor 的一个实例,如果 restype 设置为 cupy.cuda.runtime.cudaResourceTypeLinearcupy.cuda.runtime.cudaResourceTypePitch2D,则必需。

  • sizeInBytes (int, 可选) – 线性内存中的总字节数,如果 restype 设置为 cupy.cuda.runtime.cudaResourceTypeLinear,则必需。

  • width (int, 可选) – 2D 数组的宽度(以元素为单位),如果 restype 设置为 cupy.cuda.runtime.cudaResourceTypePitch2D,则必需。

  • height (int, 可选) – 2D 数组的高度(以元素为单位),如果 restype 设置为 cupy.cuda.runtime.cudaResourceTypePitch2D,则必需。

  • pitchInBytes (int, 可选) – 每行对齐后的字节数,如果 restype 设置为 cupy.cuda.runtime.cudaResourceTypePitch2D,则必需。

注意

CuPy 目前不支持基于 mipmap 数组的纹理。

方法

get_resource_desc(self)#

返回一个包含输入的字典。

__eq__(value, /)#

返回 self==value。

__ne__(value, /)#

返回 self!=value。

__lt__(value, /)#

返回 self<value。

__le__(value, /)#

返回 self<=value。

__gt__(value, /)#

返回 self>value。

__ge__(value, /)#

返回 self>=value。

属性

arr#
chDesc#
cuArr#
ptr#