From 41805dcb6885c813e69455934af4612654292765 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Mon, 19 Aug 2019 15:17:51 +0300 Subject: [PATCH] Added some error checking for the case where user supplies an incomplete meshinfo to acDeviceLoadMeshInfo --- src/core/device.cu | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/device.cu b/src/core/device.cu index 0482f93..b50478a 100644 --- a/src/core/device.cu +++ b/src/core/device.cu @@ -370,6 +370,13 @@ AcResult acDeviceLoadMeshInfo(const Device device, const Stream stream, const AcMeshInfo device_config) { cudaSetDevice(device->id); + + ERRCHK_ALWAYS(device_config.int_params[AC_nx] == device->local_config.int_params[AC_nx]); + ERRCHK_ALWAYS(device_config.int_params[AC_ny] == device->local_config.int_params[AC_ny]); + ERRCHK_ALWAYS(device_config.int_params[AC_nz] == device->local_config.int_params[AC_nz]); + ERRCHK_ALWAYS(device_config.int_params[AC_multigpu_offset] == + device->local_config.int_params[AC_multigpu_offset]); + ERRCHK_CUDA_ALWAYS(cudaMemcpyToSymbolAsync(d_mesh_info, &device_config, sizeof(device_config), 0, cudaMemcpyHostToDevice, device->streams[stream])); return AC_SUCCESS;