Ejemplo n.º 1
0
/* Finalize GPU kernel */
void si_emu_done()
{
	/* GPU report */
	if (si_emu_report_file)
		fclose(si_emu_report_file);

	/* Free ND-Ranges */
	while (si_emu->ndrange_list_count)
		si_ndrange_free(si_emu->ndrange_list_head);

	/* Free OpenCL objects */
	si_opencl_repo_free_all_objects(si_emu->opencl_repo);
	si_opencl_repo_free(si_emu->opencl_repo);

	/* Finalize disassembler */
	si_disasm_done();

	/* Finalize ISA */
	si_isa_done();

	/* Finalize GPU kernel */
	mem_free(si_emu->global_mem);
	m2s_timer_free(si_emu->timer);
	free(si_emu);
}
Ejemplo n.º 2
0
Archivo: emu.c Proyecto: ajithcj/miaow
/* Finalization */
void x86_emu_done(void)
{
	struct x86_ctx_t *ctx;

#ifdef HAVE_OPENGL
	x86_glut_done();
#endif

	/* Finalize Opengl */
	x86_opengl_done();

	/* Finish all contexts */
	for (ctx = x86_emu->context_list_head; ctx; ctx = ctx->context_list_next)
		if (!x86_ctx_get_status(ctx, x86_ctx_finished))
			x86_ctx_finish(ctx, 0);

	/* Free contexts */
	while (x86_emu->context_list_head)
		x86_ctx_free(x86_emu->context_list_head);
	
	/* Free */
	m2s_timer_free(x86_emu->timer);
	free(x86_emu);

	/* End */
	x86_isa_done();
	x86_sys_done();
}
Ejemplo n.º 3
0
void EmuDestroy(Emu *self)
{
	free(self->name);
	m2s_timer_free(self->timer);
}