summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Watry <awatry@gmail.com>2013-04-17 17:35:02 -0500
committerAaron Watry <awatry@gmail.com>2013-04-17 17:35:02 -0500
commit0f8bba36d1ce486d30ce552038128ea5076cb458 (patch)
tree3d1b9f51333a3c7ad9d5b5ed05368e17fe01be23
parent280f25c947e097ed83a04fa8816e390ba033997f (diff)
libclc: vload memory accesses are const qualified
-rw-r--r--generic/include/clc/shared/vload.h2
-rw-r--r--generic/lib/shared/vload.cl10
2 files changed, 6 insertions, 6 deletions
diff --git a/generic/include/clc/shared/vload.h b/generic/include/clc/shared/vload.h
index 40e7592..93d0750 100644
--- a/generic/include/clc/shared/vload.h
+++ b/generic/include/clc/shared/vload.h
@@ -1,5 +1,5 @@
#define _CLC_VLOAD_DECL(PRIM_TYPE, VEC_TYPE, WIDTH, ADDR_SPACE) \
- _CLC_OVERLOAD _CLC_DECL VEC_TYPE vload##WIDTH(size_t offset, ADDR_SPACE PRIM_TYPE *x);
+ _CLC_OVERLOAD _CLC_DECL VEC_TYPE vload##WIDTH(size_t offset, const ADDR_SPACE PRIM_TYPE *x);
#define _CLC_VECTOR_VLOAD_DECL(PRIM_TYPE, ADDR_SPACE) \
_CLC_VLOAD_DECL(PRIM_TYPE, PRIM_TYPE##2, 2, ADDR_SPACE) \
diff --git a/generic/lib/shared/vload.cl b/generic/lib/shared/vload.cl
index 0b1ea5e..1f266fa 100644
--- a/generic/lib/shared/vload.cl
+++ b/generic/lib/shared/vload.cl
@@ -1,23 +1,23 @@
#include <clc/clc.h>
#define VLOAD_VECTORIZE(PRIM_TYPE, ADDR_SPACE) \
- _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##2 vload2(size_t offset, ADDR_SPACE PRIM_TYPE *x) { \
+ _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##2 vload2(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \
return (PRIM_TYPE##2)(x[offset] , x[offset+1]); \
} \
\
- _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##3 vload3(size_t offset, ADDR_SPACE PRIM_TYPE *x) { \
+ _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##3 vload3(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \
return (PRIM_TYPE##3)(x[offset] , x[offset+1], x[offset+2]); \
} \
\
- _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##4 vload4(size_t offset, ADDR_SPACE PRIM_TYPE *x) { \
+ _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##4 vload4(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \
return (PRIM_TYPE##4)(vload2(offset, x), vload2(offset+2, x)); \
} \
\
- _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##8 vload8(size_t offset, ADDR_SPACE PRIM_TYPE *x) { \
+ _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##8 vload8(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \
return (PRIM_TYPE##8)(vload4(offset, x), vload4(offset+4, x)); \
} \
\
- _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##16 vload16(size_t offset, ADDR_SPACE PRIM_TYPE *x) { \
+ _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##16 vload16(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \
return (PRIM_TYPE##16)(vload8(offset, x), vload8(offset+8, x)); \
} \