Ejemplo n.º 1
0
void insieme_wi_test_implementation(irt_work_item* wi) {
	printf("WI %d here\n", wi->wg_memberships[0].num);
	irt_wg_barrier(wi->wg_memberships[0].wg_id.cached);
	irt_work_item_range loop_range = {0, 100, 1};
	irt_pfor(wi, wi->wg_memberships[0].wg_id.cached, loop_range, &g_insieme_impl_table[INSIEME_LOOP_WI_INDEX], NULL);
	irt_wg_barrier(wi->wg_memberships[0].wg_id.cached);
	loop_range.end = 1000;
	irt_pfor(wi, wi->wg_memberships[0].wg_id.cached, loop_range, &g_insieme_impl_table[INSIEME_LOOP_WI_INDEX], NULL);
	irt_wg_barrier(wi->wg_memberships[0].wg_id.cached);
}
Ejemplo n.º 2
0
void insieme_wi_test_implementation(irt_work_item* wi) {
	insieme_wi_test_params* params = (insieme_wi_test_params*)wi->parameters;
	irt_atomic_add_and_fetch(&(params->val1), irt_wi_range_get_size(&wi->range), uint64);

	ERR("A1");
	irt_wg_barrier(params->wg1);
	ERR("A2");
	if(params->val1 != NUM_WIS * WI_RANGE) { printf("Barrier error!\n"); }
	ERR("A3");
	irt_atomic_add_and_fetch(&(params->val2), irt_wi_range_get_size(&wi->range), uint64);
	ERR("A4");
	irt_wg_barrier(params->wg1);
	ERR("A5");
	if(params->val2 != NUM_WIS * WI_RANGE) { printf("Barrier error!\n"); }
	ERR("A6");
}
Ejemplo n.º 3
0
/* ------- Function Definitions --------- */
void __insieme_fun_23(int32_t* var_65, float** var_66, float** var_67, double* var_68, float** var_69) {
    {
        {
			// WINFIX: old: irt_pfor(irt_wi_get_current(), irt_wi_get_wg(irt_wi_get_current(), 0), (irt_work_item_range){1, *var_65-1, 1}, 0, (irt_lw_data_item*)(&(struct __insieme_gen_type_27){8, var_65, var_66, var_67, var_68, var_69}));
			// new:
            irt_pfor(irt_wi_get_current(), irt_wi_get_wg(irt_wi_get_current(), 0), IRT_STACK_STRUCT(irt_work_item_range, 1, *var_65-1, 1), &g_insieme_impl_table[0], (irt_lw_data_item*)(&IRT_STACK_STRUCT(_insieme_gen_type_27, 8, var_65, var_66, var_67, var_68, var_69)));
            irt_wg_barrier(irt_wi_get_wg(irt_wi_get_current(), 0));
        };
    };
}
void insieme_wi_test_implementation(irt_work_item* wi) {
	uint32 id = wi->wg_memberships[0].num;
	printf("WI %d here\n", id);
	irt_work_group* wg = wi->wg_memberships[0].wg_id.cached;
	irt_wg_barrier(wg);

	irt_work_item_range loop_range = {0, 100, 3};
	irt_schedule_loop(wi, wg, loop_range, &g_insieme_impl_table[INSIEME_LOOP_WI_INDEX], NULL);
	irt_wg_barrier(wg);
	if(id == 0) { printf("---\n"); }
	irt_wg_barrier(wg);

	irt_loop_sched_policy static10 = {IRT_STATIC_CHUNKED, 1024, .param.chunk_size = 10};
	irt_wg_set_loop_scheduling_policy(wg, &static10);
	irt_schedule_loop(wi, wg, loop_range, &g_insieme_impl_table[INSIEME_LOOP_WI_INDEX], NULL);
	irt_wg_barrier(wg);
	if(id == 0) { printf("---\n"); }
	irt_wg_barrier(wg);

	irt_loop_sched_policy dynamic10 = {IRT_DYNAMIC_CHUNKED, 1024, .param.chunk_size = 2};
	irt_wg_set_loop_scheduling_policy(wg, &dynamic10);
	irt_schedule_loop(wi, wg, loop_range, &g_insieme_impl_table[INSIEME_LOOP_WI_INDEX], NULL);
	irt_wg_barrier(wg);
	if(id == 0) { printf("---\n"); }
	irt_wg_barrier(wg);

	irt_loop_sched_policy guided10 = {IRT_GUIDED_CHUNKED, 1024, .param.chunk_size = 10};
	irt_wg_set_loop_scheduling_policy(wg, &guided10);
	irt_schedule_loop(wi, wg, loop_range, &g_insieme_impl_table[INSIEME_LOOP_WI_INDEX], NULL);
	irt_wg_barrier(wg);
	if(id == 0) { printf("---\n"); }
	irt_wg_barrier(wg);

	uint64 boundaries[] = {2, 4, 8, 16, 32, 64};
	irt_loop_sched_policy fixed_policy;
	fixed_policy.type = IRT_FIXED;
	fixed_policy.participants = 7;
	fixed_policy.param.boundaries = boundaries;
	irt_wg_set_loop_scheduling_policy(wg, &fixed_policy);
	irt_schedule_loop(wi, wg, loop_range, &g_insieme_impl_table[INSIEME_LOOP_WI_INDEX], NULL);
	irt_wg_barrier(wg);
	if(id == 0) { printf("---\n"); }
	irt_wg_barrier(wg);
}

void insieme_wi_loop_implementation(irt_work_item* wi) {
	printf("Loop WI % 2d here, from % 3ld to % 3ld\n", wi->wg_memberships[0].num, wi->range.begin, wi->range.end);
}