Explorar o código

perfmodel: new function int starpu_perfmodel_list_combs(FILE *output, struct starpu_perfmodel *model) to display the combinations of a given model

Nathalie Furmento %!s(int64=11) %!d(string=hai) anos
pai
achega
5ce44510ca
Modificáronse 2 ficheiros con 23 adicións e 0 borrados
  1. 2 0
      include/starpu_perfmodel.h
  2. 21 0
      src/core/perfmodel/perfmodel_history.c

+ 2 - 0
include/starpu_perfmodel.h

@@ -167,6 +167,8 @@ int starpu_perfmodel_list(FILE *output);
 void starpu_perfmodel_print(struct starpu_perfmodel *model, struct starpu_perfmodel_arch *arch, unsigned nimpl, char *parameter, uint32_t *footprint, FILE *output);
 int starpu_perfmodel_print_all(struct starpu_perfmodel *model, char *arch, char *parameter, uint32_t *footprint, FILE *output);
 
+int starpu_perfmodel_list_combs(FILE *output, struct starpu_perfmodel *model);
+
 void starpu_perfmodel_update_history(struct starpu_perfmodel *model, struct starpu_task *task, struct starpu_perfmodel_arch *arch, unsigned cpuid, unsigned nimpl, double measured);
 void starpu_perfmodel_directory(FILE *output);
 

+ 21 - 0
src/core/perfmodel/perfmodel_history.c

@@ -1388,3 +1388,24 @@ struct starpu_perfmodel_per_arch *starpu_perfmodel_get_model_per_arch(struct sta
 
 	return &model->per_arch[comb][impl];
 }
+
+int starpu_perfmodel_list_combs(FILE *output, struct starpu_perfmodel *model)
+{
+	int comb;
+
+	fprintf(output, "Model <%s>\n", model->symbol);
+	for(comb = 0; comb < model->ncombs; comb++)
+	{
+		struct starpu_perfmodel_arch *arch;
+		int device;
+
+		arch = _starpu_arch_comb_get(model->combs[comb]);
+		fprintf(output, "\tComb %d: %d device%s\n", model->combs[comb], arch->ndevices, arch->ndevices>1?"s":"");
+		for(device=0 ; device<arch->ndevices ; device++)
+		{
+			char *name = starpu_worker_get_as_string(arch->devices[device].type);
+			fprintf(output, "\t\tDevice %d: type: %s - devid: %d - ncores: %d\n", device, name, arch->devices[device].devid, arch->devices[device].ncores);
+		}
+	}
+	return 0;
+}