浏览代码

examples/basic_examples/: stdint.h might not be available in OpenCL

Nathalie Furmento 13 年之前
父节点
当前提交
c7de5b704c
共有 2 个文件被更改,包括 6 次插入8 次删除
  1. 5 5
      examples/basic_examples/block_opencl.c
  2. 1 3
      examples/basic_examples/block_opencl_kernel.cl

+ 5 - 5
examples/basic_examples/block_opencl.c

@@ -36,11 +36,11 @@ void opencl_codelet(void *descr[], void *_args)
 	cl_event event;
 	int id, devid, err;
 	cl_mem block = (cl_mem)STARPU_BLOCK_GET_DEV_HANDLE(descr[0]);
-	uint32_t nx = (int)STARPU_BLOCK_GET_NX(descr[0]);
-	uint32_t ny = (int)STARPU_BLOCK_GET_NY(descr[0]);
-	uint32_t nz = (int)STARPU_BLOCK_GET_NZ(descr[0]);
-        uint32_t ldy = STARPU_BLOCK_GET_LDY(descr[0]);
-        uint32_t ldz = STARPU_BLOCK_GET_LDZ(descr[0]);
+	int nx = (int)STARPU_BLOCK_GET_NX(descr[0]);
+	int ny = (int)STARPU_BLOCK_GET_NY(descr[0]);
+	int nz = (int)STARPU_BLOCK_GET_NZ(descr[0]);
+        int ldy = (int)STARPU_BLOCK_GET_LDY(descr[0]);
+        int ldz = (int) STARPU_BLOCK_GET_LDZ(descr[0]);
         float *multiplier = (float *)_args;
 
         id = starpu_worker_get_id();

+ 1 - 3
examples/basic_examples/block_opencl_kernel.cl

@@ -14,9 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include <stdint.h>
-
-__kernel void block(__global float *b, uint32_t nx, uint32_t ny, uint32_t nz, uint32_t ldy, uint32_t ldz, float multiplier)
+__kernel void block(__global float *b, int nx, int ny, int nz, int ldy, int ldz, float multiplier)
 {
      const int i = get_global_id(0);
      if (i < (nz*ldz)+(ny*ldy)+nx)