码迷,mamicode.com
首页 > 其他好文 > 详细

OpenCL size_t error

时间:2015-08-16 13:38:18      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

编程测试当中遇到这么一个问题:

1,增加kernel时OpenCL编译报错,AMD 平台报错说该source kernel无法生成相应的executable program object;

2,但是同一套代码在intel E3上可以正常运行;

 

很明显,又是implementation-dependent的问题;

这次问题出在了size_t的实现上,已经实验验证;在这里(LINK)有简单的描述,自己编程当中使用size_t没有遵守OpenCL-restriction,

毕竟对于这种平台相关的类型,coder最好遵循手册要求。。。。

Arguments to __kernel functions in a program cannot be declared with the built-in scalar types bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t. The size in bytes of these types except half are implementation-defined and in addition can also be different for the OpenCL device and the host processor making it difficult to allocate buffer objects to be passed as arguments to a kernel declared as pointer to these types. half is not supported as half can be used as a storage format only and is not a data type on which floating-point arithmetic can be performed.

 

做个记忆:

size_t can be a 32-bit or a 64-bit unsigned integer, and the OpenCL compiler does not accept variable types that are implementation-dependent.

 

OpenCL size_t error

标签:

原文地址:http://www.cnblogs.com/superniaoren/p/4733974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!