Selaa lähdekoodia

Driver CUDA: Extract PCI Informations when available

Nathalie Furmento 14 vuotta sitten
vanhempi
commit
f6758e6907
2 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 2 2
      src/core/workers.h
  2. 5 2
      src/drivers/cuda/driver_cuda.c

+ 2 - 2
src/core/workers.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -76,7 +76,7 @@ struct starpu_worker_s {
 	unsigned worker_is_running;
 	unsigned worker_is_initialized;
 	starpu_worker_status status; /* what is the worker doing now ? (eg. CALLBACK) */
-	char name[32];
+	char name[48];
 
 #ifdef __GLIBC__
 	cpu_set_t initial_cpu_set;

+ 5 - 2
src/drivers/cuda/driver_cuda.c

@@ -262,8 +262,11 @@ void *_starpu_cuda_worker(void *arg)
 	struct cudaDeviceProp prop;
 	cudaGetDeviceProperties(&prop, devid);
 	strncpy(devname, prop.name, 128);
-	snprintf(args->name, 32, "CUDA %d (%s)", args->devid, devname);
-
+#if CUDA_VERSION >= 3020
+	snprintf(args->name, 48, "CUDA %d (%s %02x:%02x.0)", args->devid, devname, prop.pciBusID, prop.pciDeviceID);
+#else
+	snprintf(args->name, 48, "CUDA %d (%s)", args->devid, devname);
+#endif
 	_STARPU_DEBUG("cuda (%s) dev id %d thread is ready to run on CPU %d !\n", devname, devid, args->bindid);
 
 	STARPU_TRACE_WORKER_INIT_END