浏览代码

src: increase name size to make sure it will not be too short

Nathalie Furmento 6 年之前
父节点
当前提交
ed0688a538
共有 3 个文件被更改,包括 7 次插入7 次删除
  1. 1 1
      src/core/workers.h
  2. 3 3
      src/drivers/cuda/driver_cuda.c
  3. 3 3
      src/drivers/opencl/driver_opencl.c

+ 1 - 1
src/core/workers.h

@@ -153,7 +153,7 @@ LIST_TYPE(_starpu_worker,
 	unsigned worker_is_initialized;
 	enum _starpu_worker_status status; /**< what is the worker doing now ? (eg. CALLBACK) */
 	unsigned state_keep_awake; /**< !0 if a task has been pushed to the worker and the task has not yet been seen by the worker, the worker should no go to sleep before processing this task*/
-	char name[64];
+	char name[128];
 	char short_name[32];
 	unsigned run_by_starpu; /**< Is this run by StarPU or directly by the application ? */
 	struct _starpu_driver_ops *driver_ops;

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

@@ -717,9 +717,9 @@ int _starpu_cuda_driver_init(struct _starpu_worker_set *worker_set)
 		const char *devname = "Simgrid";
 #else
 		/* get the device's name */
-		char devname[16];
-		strncpy(devname, props[devid].name, 15);
-		devname[15] = 0;
+		char devname[64];
+		strncpy(devname, props[devid].name, 63);
+		devname[63] = 0;
 #endif
 
 #if defined(STARPU_HAVE_BUSID) && !defined(STARPU_SIMGRID)

+ 3 - 3
src/drivers/opencl/driver_opencl.c

@@ -3,7 +3,7 @@
  * Copyright (C) 2011,2012,2014-2017                      Inria
  * Copyright (C) 2010-2018                                Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2017, 2019                                CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
  *
@@ -641,8 +641,8 @@ int _starpu_opencl_driver_init(struct _starpu_worker *worker)
 	const char *devname = "Simgrid";
 #else
 	/* get the device's name */
-	char devname[32];
-	_starpu_opencl_get_device_name(devid, devname, 32);
+	char devname[64];
+	_starpu_opencl_get_device_name(devid, devname, 64);
 #endif
 	snprintf(worker->name, sizeof(worker->name), "OpenCL %d (%s %.1f GiB)", devid, devname, size);
 	snprintf(worker->short_name, sizeof(worker->short_name), "OpenCL %d", devid);