Explorar el Código

CUDA versions are apparently not enough to make sure the fields are there, just detect from configure

Samuel Thibault hace 13 años
padre
commit
ec7be460d7
Se han modificado 2 ficheros con 10 adiciones y 2 borrados
  1. 8 0
      configure.ac
  2. 2 2
      src/drivers/cuda/driver_cuda.c

+ 8 - 0
configure.ac

@@ -1407,6 +1407,14 @@ if test "x$ICC" != "x"; then
 fi
 AM_CONDITIONAL([STARPU_HAVE_ICC], [test "x$ICC" != "x"])
 
+AC_CHECK_MEMBER([struct cudaDeviceProp.pciDomainID],
+  AC_DEFINE([STARPU_HAVE_DOMAINID],[1],[Define to 1 if CUDA device properties include DomainID]),
+  , [[#include <cuda_runtime_api.h>]])
+
+AC_CHECK_MEMBER([struct cudaDeviceProp.pciBusID],
+  AC_DEFINE([STARPU_HAVE_BUSID],[1],[Define to 1 if CUDA device properties include BusID]),
+  , [[#include <cuda_runtime_api.h>]])
+
 # File configuration
 AC_CONFIG_COMMANDS([executable-scripts], [
   chmod +x tests/regression/regression.sh

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

@@ -272,8 +272,8 @@ void *_starpu_cuda_worker(void *arg)
 	strncpy(devname, prop.name, 128);
 	float size = (float) prop.totalGlobalMem / (1<<30);
 
-#if CUDA_VERSION >= 3020
-#if CUDA_VERSION >= 4000
+#ifdef STARPU_HAVE_BUSID
+#ifdef STARPU_HAVE_DOMAINID
 	if (prop.pciDomainID)
 		snprintf(args->name, sizeof(args->name), "CUDA %d (%s %.1f GiB %04x:%02x:%02x.0)", args->devid, devname, size, prop.pciDomainID, prop.pciBusID, prop.pciDeviceID);
 	else