aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGil Pitney <gil.pitney@linaro.org>2014-11-21 18:23:53 -0800
committerGil Pitney <gil.pitney@linaro.org>2014-11-21 18:23:53 -0800
commit5d2eb9a1fc2ea97f717f1f819a088364412c9ddc (patch)
tree5a7be25dc549d49ff0aa5e39e6450067cbcedcbe
parent183e63662bf50e5cb18e49db7a122f38c6a43f7b (diff)
downloadshamrock-basic_parameter_types.tar.gz
test: parameter types: updated to test for int4 to float4 conversion.basic_parameter_types
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r--tests/basic_parameter_types.cl4
-rw-r--r--tests/test_basic_parameter_types.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/basic_parameter_types.cl b/tests/basic_parameter_types.cl
index 99ea4e7..66fb628 100644
--- a/tests/basic_parameter_types.cl
+++ b/tests/basic_parameter_types.cl
@@ -1,4 +1,4 @@
-__kernel void test_kernel(char4 c, __global float4 *result)
+__kernel void test_kernel(int4 i, __global float4 *result)
{
- result[0] = convert_float4(c);
+ result[0] = convert_float4(i);
}
diff --git a/tests/test_basic_parameter_types.cpp b/tests/test_basic_parameter_types.cpp
index 680ecaf..b703b16 100644
--- a/tests/test_basic_parameter_types.cpp
+++ b/tests/test_basic_parameter_types.cpp
@@ -44,7 +44,7 @@ START_TEST (test_basic_parameter_types)
cl_int error;
cl_kernel kernel;
cl_mem results;
- cl_char c[4]={0,1,2,3}; // input: one char4 vector.
+ cl_int i[4]={0,1,2,3}; // input: one int4 vector.
float results_back[1*4] = {0.0f, 0.0f, 0.0f, 0.0f}; // output: one float4 vector.
bool ok = true;
float expected;
@@ -109,7 +109,7 @@ START_TEST (test_basic_parameter_types)
"cannot create a valid read-write buffer"
);
- error = clSetKernelArg(kernel, 0, sizeof(cl_char)*4, &c);
+ error = clSetKernelArg(kernel, 0, sizeof(cl_int)*4, &i);
fail_if(
error != CL_SUCCESS,
"cannot set kernel argument"
@@ -127,7 +127,7 @@ START_TEST (test_basic_parameter_types)
// Verify the results
for (int index = 0; index < 4; index++) {
- expected = (float)c[index];
+ expected = (float)i[index];
if (results_back[index] != expected) {
std::cout << "Conversion from char failed: got " << results_back[index] << ",expected " << expected << std::endl;
ok = false;