// // Copyright (c) 2017 The Khronos Group Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #include "harness/compat.h" #include #include #include #include #include "procs.h" static int test_step_double(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems); const char *step_kernel_code = "__kernel void test_step(__global float *srcA, __global float *srcB, __global float *dst)\n" "{\n" " int tid = get_global_id(0);\n" "\n" " dst[tid] = step(srcA[tid], srcB[tid]);\n" "}\n"; const char *step2_kernel_code = "__kernel void test_step2(__global float2 *srcA, __global float2 *srcB, __global float2 *dst)\n" "{\n" " int tid = get_global_id(0);\n" "\n" " dst[tid] = step(srcA[tid], srcB[tid]);\n" "}\n"; const char *step4_kernel_code = "__kernel void test_step4(__global float4 *srcA, __global float4 *srcB, __global float4 *dst)\n" "{\n" " int tid = get_global_id(0);\n" "\n" " dst[tid] = step(srcA[tid], srcB[tid]);\n" "}\n"; const char *step8_kernel_code = "__kernel void test_step8(__global float8 *srcA, __global float8 *srcB, __global float8 *dst)\n" "{\n" " int tid = get_global_id(0);\n" "\n" " dst[tid] = step(srcA[tid], srcB[tid]);\n" "}\n"; const char *step16_kernel_code = "__kernel void test_step16(__global float16 *srcA, __global float16 *srcB, __global float16 *dst)\n" "{\n" " int tid = get_global_id(0);\n" "\n" " dst[tid] = step(srcA[tid], srcB[tid]);\n" "}\n"; const char *step3_kernel_code = "__kernel void test_step3(__global float *srcA, __global float *srcB, __global float *dst)\n" "{\n" " int tid = get_global_id(0);\n" "\n" " vstore3(step(vload3(tid,srcA), vload3(tid,srcB)),tid,dst);\n" "}\n"; int verify_step(float *inptrA, float *inptrB, float *outptr, int n) { float r; int i; for (i=0; i