#include #include #include #include using namespace std; // Autogenerated strings containing the OpenCL source code for our // kernels // Note: These names of these variables contain the thorn name extern char const *const OpenCL_source_WaveToyOpenCL_init; extern char const *const OpenCL_source_WaveToyOpenCL_evol; extern char const *const OpenCL_source_WaveToyOpenCL_boundary; extern "C" void WaveToyOpenCL_Init(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; if (verbose) { CCTK_VInfo(CCTK_THORNSTRING, "WaveToyOpenCL_Init iteration=%d time=%.15g", cctk_iteration, double(cctk_time)); } // The variable groups accessed by this kernel (defining the // kernel's CCTK_ARGUMENTS list) char const *const groups[] = { "WaveToyOpenCL::Scalar", NULL}; int const imin[] = {0, 0, 0}; int const imax[] = {cctk_lsh[0], cctk_lsh[1], cctk_lsh[2]}; static struct OpenCLKernel *kernel = NULL; char const *const sources[] = {"", OpenCL_source_WaveToyOpenCL_init, NULL}; OpenCLRunTime_CallKernel(cctkGH, CCTK_THORNSTRING, "init", sources, groups, NULL, NULL, NULL, -1, imin, imax, &kernel); } extern "C" void WaveToyOpenCL_Evol(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; if (verbose) { CCTK_VInfo(CCTK_THORNSTRING, "WaveToyOpenCL_Evol iteration=%d time=%.15g", cctk_iteration, double(cctk_time)); } // The variable groups accessed by this kernel (defining the // kernel's CCTK_ARGUMENTS list) char const *const groups[] = { "WaveToyOpenCL::Scalar", NULL}; int const imin[] = {cctk_nghostzones[0], cctk_nghostzones[1], cctk_nghostzones[2]}; int const imax[] = {cctk_lsh[0] - cctk_nghostzones[0], cctk_lsh[1] - cctk_nghostzones[1], cctk_lsh[2] - cctk_nghostzones[2]}; static struct OpenCLKernel *kernel = NULL; char const *const sources[] = {"", OpenCL_source_WaveToyOpenCL_evol, NULL}; OpenCLRunTime_CallKernel(cctkGH, CCTK_THORNSTRING, "evol", sources, groups, NULL, NULL, NULL, -1, imin, imax, &kernel); } extern "C" void WaveToyOpenCL_Boundary(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; if (verbose) { CCTK_VInfo(CCTK_THORNSTRING, "WaveToyOpenCL_Boundary iteration=%d time=%.15g", cctk_iteration, double(cctk_time)); } // The variable groups accessed by this kernel (defining the // kernel's CCTK_ARGUMENTS list) char const *const groups[] = { "WaveToyOpenCL::Scalar", NULL}; for (int dir=0; dir<3; ++dir) { for (int face=0; face<2; ++face) { if (cctk_bbox[2*dir+face]) { int imin[] = {0, 0, 0}; int imax[] = {cctk_lsh[0], cctk_lsh[1], cctk_lsh[2]}; if (face == 0) { imax[dir] = imin[dir] + cctk_nghostzones[dir]; } else { imin[dir] = imax[dir] - cctk_nghostzones[dir]; } static struct OpenCLKernel *kernel = NULL; char const *const sources[] = {"", OpenCL_source_WaveToyOpenCL_boundary, NULL}; OpenCLRunTime_CallKernel(cctkGH, CCTK_THORNSTRING, "boundary", sources, groups, NULL, NULL, NULL, -1, imin, imax, &kernel); } // if bbox } // for face } // for dir }