summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernels/compiler_bswap.cl1
-rw-r--r--utests/compiler_bswap.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/kernels/compiler_bswap.cl b/kernels/compiler_bswap.cl
index 9ef0e6b7..97313b1a 100644
--- a/kernels/compiler_bswap.cl
+++ b/kernels/compiler_bswap.cl
@@ -1,6 +1,7 @@
#define TEST_TYPE(TYPE, LENGTH) \
kernel void compiler_bswap_##TYPE(global TYPE * src, global TYPE * dst){ \
dst[get_global_id(0)]= __builtin_bswap##LENGTH(src[get_global_id(0)]); \
+ dst[get_global_id(0)]= __builtin_bswap##LENGTH(dst[get_global_id(0)] -1 ); \
}
diff --git a/utests/compiler_bswap.cpp b/utests/compiler_bswap.cpp
index b5986b90..9475b991 100644
--- a/utests/compiler_bswap.cpp
+++ b/utests/compiler_bswap.cpp
@@ -85,6 +85,13 @@ void test(const char *kernel_name)
for (int32_t i = 0; i < (int32_t) n; ++i)
cpu(i, cpu_src, cpu_dst);
+ for (int32_t i = 0; i < (int32_t) n; ++i)
+ cpu_dst[i] = cpu_dst[i] -1;
+
+ // Run on CPU
+ for (int32_t i = 0; i < (int32_t) n; ++i)
+ cpu(i, cpu_dst, cpu_dst);
+
OCL_MAP_BUFFER(1);
// dump_data(cpu_src, cpu_dst, n);