Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
From 10dfeb9833be69dae8b3fd6e8cf7081cbda6fb46 Mon Sep 17 00:00:00 2001
From: Alexander Tarasikov <alexander.tarasikov@gmail.com>
Date: Tue, 6 Sep 2016 14:38:06 +0300
Subject: [PATCH] Fix compilation with LLVM 4.0.0
---
generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl | 2 +-
generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl | 2 +-
generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl | 2 +-
generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl b/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
index a74158d..cc24d2f 100644
--- a/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
+++ b/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
@@ -2,7 +2,7 @@
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(global TYPE *p) { \
- return atom_sub(p, 1); \
+ return atom_sub(p, (TYPE)1); \
}
IMPL(int)
diff --git a/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl b/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
index 1404b5a..9193ae3 100644
--- a/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
+++ b/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
@@ -2,7 +2,7 @@
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(global TYPE *p) { \
- return atom_add(p, 1); \
+ return atom_add(p, (TYPE)1); \
}
IMPL(int)
diff --git a/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl b/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
index d22c333..cfb3d80 100644
--- a/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
+++ b/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
@@ -2,7 +2,7 @@
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(local TYPE *p) { \
- return atom_sub(p, 1); \
+ return atom_sub(p, (TYPE)1); \
}
IMPL(int)
diff --git a/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl b/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl
index 4ba0d06..8ea4738 100644
--- a/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl
+++ b/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl
@@ -2,7 +2,7 @@
#define IMPL(TYPE) \
_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(local TYPE *p) { \
- return atom_add(p, 1); \
+ return atom_add(p, (TYPE)1); \
}
IMPL(int)
--
2.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment