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)[源代码]#
一个持有资源描述的类。等同于
cudaResourceDesc。- 参数:
restype (int) – 资源类型。使用
cudaResourceType*中的一个值,例如cupy.cuda.runtime.cudaResourceTypeArray。cuArr (CUDAarray, optional) – 一个
CUDAarray的实例,如果restype设置为cupy.cuda.runtime.cudaResourceTypeArray,则需要此实例。arr (cupy.ndarray, optional) – 一个
ndarray的实例,如果restype设置为cupy.cuda.runtime.cudaResourceTypeLinear或cupy.cuda.runtime.cudaResourceTypePitch2D时需要。chDesc (ChannelFormatDescriptor, optional) – 一个
ChannelFormatDescriptor的实例,如果restype设置为cupy.cuda.runtime.cudaResourceTypeLinear或cupy.cuda.runtime.cudaResourceTypePitch2D,则此项为必需。sizeInBytes (int, optional) – 线性内存中的总字节数,如果
restype设置为cupy.cuda.runtime.cudaResourceTypeLinear,则需要此项。width (int, optional) – 二维数组的宽度(以元素为单位),如果
restype设置为cupy.cuda.runtime.cudaResourceTypePitch2D,则此项为必需。height (int, optional) – 二维数组的高度(以元素为单位),如果
restype设置为cupy.cuda.runtime.cudaResourceTypePitch2D则需要此项。pitchInBytes (int, optional) – 每个对齐行所占的字节数,如果
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#