瀏覽代碼

Avoid arithmetic over void pointer, refused by more recent opencl implementations

Samuel Thibault 8 年之前
父節點
當前提交
931099ec5f
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      examples/filters/fblock_opencl_kernel.cl
  2. 2 2
      tests/datawizard/scal_opencl.cl

+ 1 - 1
examples/filters/fblock_opencl_kernel.cl

@@ -19,7 +19,7 @@
 __kernel void fblock_opencl(__global int* block, unsigned offset, int nx, int ny, int nz, unsigned ldy, unsigned ldz, int factor)
 {
         int i, j, k;
-        block = (__global void *)block + offset;
+        block = (__global char *)block + offset;
         for(k=0; k<nz ; k++)
 	{
                 for(j=0; j<ny ; j++)

+ 2 - 2
tests/datawizard/scal_opencl.cl

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2011, 2012  CNRS
- * Copyright (C) 2011  Université Bordeaux
+ * Copyright (C) 2011, 2017  Université Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -18,7 +18,7 @@
 __kernel void vector_mult_opencl(__global unsigned* val, unsigned offset, unsigned nx)
 {
         const int i = get_global_id(0);
-	val = (__global void*) val + offset;
+	val = (__global char*) val + offset;
         if (i < nx)
 	{
                 val[i] *= 2;