Quantcast
Channel: Intel® Software - OpenCL*
Viewing all articles
Browse latest Browse all 1182

Is there any GEN-friendly idiom for communicating subgroup uniformity?

$
0
0

It seems to me that GEN might benefit more from detecting "subgroup uniform" values than other architectures because of its unique register file architecture and instruction set.

Are there are any GEN idioms that you've discovered that nudge/help the compiler so it's able to determine that variables used by a subgroup are actually scalars (subgroup uniform)?

For example, would an idiom like this:

kernel foo(...)
{
  uint const sg_id = get_sub_group_id();

  if (sg_id == get_sub_group_id())
  {
    // rest of kernel
  }
}

or an idiom like this (perhaps better):

kernel foo(...)
{
  if (sub_group_all(true))
  {
    // rest of kernel
  }
}

... help the compiler determine that the subgroups are running "in isolation" and therefore any future function involving get_sub_group_id() (or similar) would be uniform?

I suspect this hasn't been implemented but it might be a useful idiom for both performance and reducing register pressure.


Viewing all articles
Browse latest Browse all 1182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>