Results 1 to 2 of 2

Thread: calling kernel from another kernel

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    26

    calling kernel from another kernel

    Hi,
    could I call & execute a kernel function from another kernel function?
    my GPU code does some computation on some input data and in the middle of the computations, it needs to compare the input with an array of about 1000 values sequentially! so this of course is not efficient and increases the running time... so I thought of extracting the search code alone and letting it be executed in parallel too... is this feasible?

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: calling kernel from another kernel

    could I call & execute a kernel function from another kernel function?
    Yes, that is legal. However, this has the same semantics as calling any other function. In other words, it will not spawn new work-items.

    There is no way to generate new work-items from a running kernel.

    it needs to compare the input with an array of about 1000 values sequentially!
    Is this something you could improve with a better data structure such as a hash table or a search tree? What about applying a reduction? (To find the max/min/etc).
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Calling a kernel from within a kernel?
    By FredericX in forum OpenCL
    Replies: 3
    Last Post: 10-09-2010, 08:26 AM
  2. calling the same kernel object multiple times
    By poonaatsoc in forum OpenCL
    Replies: 3
    Last Post: 07-29-2009, 12:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •