/* Check if a GRU context is allowed to use a specific chiplet. By default a context is assigned to any blade-local chiplet. However, users can override this. Returns 1 if assignment allowed, 0 otherwise  */
static int gru_check_chiplet_assignment(struct gru_state *gru, struct gru_thread_state *gts)
/* Check if a GRU context is allowed to use a specific chiplet. By default a context is assigned to any blade-local chiplet. However, users can override this. Returns 1 if assignment allowed, 0 otherwise  */
static int gru_check_chiplet_assignment(struct gru_state *gru, struct gru_thread_state *gts)
{
	int blade_id;
	int chiplet_id;
	blade_id = gts->ts_user_blade_id;
	if (blade_id < 0)
		blade_id = uv_numa_blade_id();
	chiplet_id = gts->ts_user_chiplet_id;
	return gru->gs_blade_id == blade_id &&
		(chiplet_id < 0 || chiplet_id == gru->gs_chiplet_id);
}