OpenCL™规范 5.3.2.2. OpenCL内核语言图像访问限定符的图像格式映射

5.3.2.2. Image Format Mapping to OpenCL Kernel Language Image Access Qualifiers
5.3.2.2. OpenCL内核语言图像访问限定符的图像格式映射

Image arguments to kernels may have the read_onlywrite_only or read_write qualifier. Not all image formats supported by the device and platform are valid to be passed to all of these access qualifiers. For each access qualifier, only images whose format is in the list of formats returned by clGetSupportedImageFormats with the given flag arguments in the Image Format Mapping table are permitted. It is not valid to pass an image supporting writing as both a read_only image and a write_only image parameter, or to a read_write image parameter and any other image parameter.

​内核的映像参数可能具有read_only、write_only或read_write限定符。并非设备和平台支持的所有图像格式都可以有效地传递给所有这些访问限定符。对于每个访问限定符,只允许其格式在“图像格式映射”表中具有给定标志参数的clGetSupportedImageFormats返回的格式列表中的图像。将支持写入的图像作为只读图像和只读图像参数传递,或传递给读写图像参数和任何其他图像参数都是无效的。

Table 30. Mapping from format flags passed to clGetSupportedImageFormats to OpenCL kernel language image access qualifiers

​表30 从传递给clGetSupportedImageFormats的格式标志到OpenCL内核语言映像访问限定符的映射

Access Qualifier

访问限定符

Memory Flags

内存标志

read_only

CL_MEM_READ_ONLY,
CL_MEM_READ_WRITE,
CL_MEM_KERNEL_READ_AND_WRITE

write_only

CL_MEM_WRITE_ONLY,
CL_MEM_READ_WRITE,
CL_MEM_KERNEL_READ_AND_WRITE

read_write

CL_MEM_KERNEL_READ_AND_WRITE

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值