浏览代码

Make pack allocate aligned buffers for o_direct to be able to work

Samuel Thibault 10 年之前
父节点
当前提交
12d79745d1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/interface/complex_interface.c

+ 2 - 1
examples/interface/complex_interface.c

@@ -137,7 +137,8 @@ static int complex_pack_data(starpu_data_handle_t handle, unsigned node, void **
 	if (ptr != NULL)
 	{
 		char *data;
-		data = *ptr = malloc(*count);
+		starpu_malloc_flags(&data, *count, 0);
+		*ptr = data;
 		memcpy(data, complex_interface->real, complex_interface->nx*sizeof(double));
 		memcpy(data+complex_interface->nx*sizeof(double), complex_interface->imaginary, complex_interface->nx*sizeof(double));
 	}