fix ADM Constrant Violation Analysis
This commit is contained in:
@@ -4997,6 +4997,17 @@ static void download_state_outputs(double **state_host_out, size_t all)
|
||||
}
|
||||
}
|
||||
|
||||
static void download_constraint_outputs(double **constraint_host_out, size_t all)
|
||||
{
|
||||
const size_t bytes = all * sizeof(double);
|
||||
CUDA_CHECK(cudaMemcpy(g_buf.h_stage, g_buf.slot[S_ham_Res],
|
||||
(size_t)D2H_CONSTRAINT_SLOT_COUNT * bytes,
|
||||
cudaMemcpyDeviceToHost));
|
||||
for (int i = 0; i < D2H_CONSTRAINT_SLOT_COUNT; ++i) {
|
||||
std::memcpy(constraint_host_out[i], g_buf.h_stage + (size_t)i * all, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
__global__ void kern_pack_state_region_batch(const double * __restrict__ src_mem,
|
||||
double * __restrict__ dst,
|
||||
int nx, int ny,
|
||||
@@ -5818,6 +5829,17 @@ int bssn_cuda_download_resident_state(void *block_tag,
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int bssn_cuda_download_constraint_outputs(int *ex,
|
||||
double **constraint_host_out)
|
||||
{
|
||||
init_gpu_dispatch();
|
||||
CUDA_CHECK(cudaSetDevice(g_dispatch.my_device));
|
||||
const size_t all = (size_t)ex[0] * ex[1] * ex[2];
|
||||
download_constraint_outputs(constraint_host_out, all);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int bssn_cuda_pack_state_region_to_host_buffer(void *block_tag,
|
||||
int state_index,
|
||||
|
||||
Reference in New Issue
Block a user