zoukankan      html  css  js  c++  java
  • OpenCL size_t error

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

    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.

  • 相关阅读:
    HDFS与YARN HA部署配置文件
    Zookeeper学习(一)
    Kafka学习(一)
    Azkaban(3.x)编译安装使用
    回归问题及应用
    K好数
    最大最小公倍数
    区间K大数查询
    幂方分解
    瓷砖铺放
  • 原文地址:https://www.cnblogs.com/superniaoren/p/4733974.html
Copyright © 2011-2022 走看看