瀏覽代碼

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

Samuel Thibault 13 年之前
父節點
當前提交
ec7be460d7
共有 2 個文件被更改,包括 10 次插入2 次删除
  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