Results 1 to 2 of 2

Thread: reg kernel function(linear search)

  1. #1
    Junior Member
    Join Date
    Mar 2011

    reg kernel function(linear search)

    __kernel void lin_search (__global const float *a,float c,int pos)
    int tid = get_global_id(0);

    Is this function is right for searching an element using linear search?


  2. #2

    Re: reg kernel function(linear search)

    Almost! You need to get the output through a buffer, however. Actually, I'm not sure if this is the only way, but definitely the standard:

    Code :
    __kernel void lin_search (__global const float *a,float c,__global unsigned int *pos)
    	int tid = get_global_id(0);

    EDIT: if the search returns true for more than one element, you have a data-racing issue, however...

Similar Threads

  1. reg kernel function
    By paviraj_1989 in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 0
    Last Post: 03-19-2011, 11:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean