From f79f4ef56a98a8a9a4c756f41f53322002238ac4 Mon Sep 17 00:00:00 2001 From: Benjamin Segovia Date: Thu, 10 May 2012 20:09:32 +0000 Subject: Fixed this damn fucking relocation bug! --- utests/compiler_byte_scatter.cpp | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 utests/compiler_byte_scatter.cpp (limited to 'utests/compiler_byte_scatter.cpp') diff --git a/utests/compiler_byte_scatter.cpp b/utests/compiler_byte_scatter.cpp new file mode 100644 index 00000000..115f5df3 --- /dev/null +++ b/utests/compiler_byte_scatter.cpp @@ -0,0 +1,43 @@ +/* + * Copyright © 2012 Intel Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Author: Benjamin Segovia + */ + +#include "utest_helper.hpp" + +static void compiler_byte_scatter(void) +{ + const size_t n = 128; + + // Setup kernel and buffers + OCL_CREATE_KERNEL("compiler_byte_scatter"); + OCL_CREATE_BUFFER(buf[0], 0, n * sizeof(int8_t), NULL); + + // Run the kernel + OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]); + globals[0] = n; + locals[0] = 16; + OCL_NDRANGE(1); + + // Check result + OCL_MAP_BUFFER(0); + for (int32_t i = 0; i < (int32_t) n; ++i) + OCL_ASSERT(((int8_t*)buf_data[0])[i] == (int8_t) i); +} + +MAKE_UTEST_FROM_FUNCTION(compiler_byte_scatter); + -- cgit v1.2.1