+2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
+
+ * brig/brigfrontend/brig-code-entry-handler.cc: The modulo in
+ ID computation should not be needed.
+
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brig/brig-lang.c: Add support for whole program
tree local_id_var = m_parent.m_cf->m_local_id_vars[dim];
tree wg_id_var = m_parent.m_cf->m_wg_id_vars[dim];
tree wg_size_var = m_parent.m_cf->m_wg_size_vars[dim];
- tree grid_size_var = m_parent.m_cf->m_grid_size_vars[dim];
tree wg_id_x_wg_size = build2 (MULT_EXPR, uint32_type_node,
convert (uint32_type_node, wg_id_var),
tree sum
= build2 (PLUS_EXPR, uint32_type_node, wg_id_x_wg_size, local_id_var);
- /* We need a modulo here because of work-groups which have dimensions
- larger than the grid size :( TO CHECK: is this really allowed in the
- specs? */
- tree modulo
- = build2 (TRUNC_MOD_EXPR, uint32_type_node, sum, grid_size_var);
-
return add_temp_var (std::string ("workitemabsid_")
- + (char) ((int) 'x' + dim),
- modulo);
+ + (char) ((int) 'x' + dim), sum);
}
else if (brig_opcode == BRIG_OPCODE_WORKITEMFLATID)
{