accelerInt
v0.1
|
Functions | |
__global__ void | intDriver (const int NUM, const double t, const double t_end, const double *__restrict__ pr_global, double *__restrict__ y_global, const mechanism_memory *__restrict__ d_mem, const solver_memory *__restrict__ s_mem) |
Generic driver for the GPU integrators. More... | |
__device__ void | integrate (const double, const double, const double, double *const __restrict__, mechanism_memory const *const __restrict__, solver_memory const *const __restrict__) |
__host__ void | check_error (int num_conditions, int *code_arr) |
size_t | required_solver_size () |
Returns the total size (in bytes) required for memory storage for a single GPU thread Used in calculation of the maximum number of possible GPU threads to launch, this method returns the size of the solver_memory structure (per-GPU thread) More... | |
void | init_solver_log () |
Initializes solver specific items for logging. More... | |
void | solver_log () |
Executes solver specific logging tasks. More... | |
void | initialize_solver (const int, solver_memory **, solver_memory **) |
void | cleanup_solver (solver_memory **, solver_memory **) |
const char * | solver_name () |
Returns a descriptive solver name. More... | |
void | memcpy2D_in (double *dst, const int pitch_dst, double const *src, const int pitch_src, const int offset, const size_t width, const int height) |
A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions. More... | |
void | memcpy2D_out (double *dst, const int pitch_dst, double const *src, const int pitch_src, const int offset, const size_t width, const int height) |
A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions. More... | |
void | accelerInt_initialize (int NUM, int device) |
Initializes the solver. More... | |
void | accelerInt_integrate (const int NUM, const double t_start, const double t_end, const double stepsize, double *__restrict__ y_host, const double *__restrict__ var_host) |
integrate NUM odes from time t_start to time t_end , using stepsizes of stepsize More... | |
void | accelerInt_cleanup () |
Cleans up the solver. More... | |
Variables | |
int | padded |
Padded # of ODEs to solve. More... | |
solver_memory * | host_solver |
The solver memory structs. More... | |
solver_memory * | device_solver |
mechanism_memory * | host_mech |
The mechanism memory structs. More... | |
mechanism_memory * | device_mech |
dim3 | dimBlock |
block and grid sizes More... | |
dim3 | dimGrid |
int * | result_flag |
result flag More... | |
double * | y_temp |
temorary storage More... | |
void genericcu::accelerInt_cleanup | ( | ) |
Cleans up the solver.
Definition at line 217 of file solver_interface.cu.
void genericcu::accelerInt_initialize | ( | int | NUM, |
int | device | ||
) |
Initializes the solver.
[in] | NUM | The number of ODEs to integrate |
[in] | device | The CUDA device number, if < 0 set to the first available GPU |
Definition at line 88 of file solver_interface.cu.
void genericcu::accelerInt_integrate | ( | const int | NUM, |
const double | t_start, | ||
const double | t_end, | ||
const double | stepsize, | ||
double *__restrict__ | y_host, | ||
const double *__restrict__ | var_host | ||
) |
integrate NUM odes from time t_start
to time t_end
, using stepsizes of stepsize
integrate NUM odes from time t_start
to time t_end
, using stepsizes of t_step
[in] | NUM | The number of ODEs to integrate. This should be the size of the leading dimension of y_host and var_host . |
[in] | t_start | The starting time |
[in] | t_end | The end time |
[in] | stepsize | The integration step size. If stepsize < 0, the step size will be set to t_end - t |
[in,out] | y_host | The state vectors to integrate. |
[in] | var_host | The parameters to use in dydt() and eval_jacob() |
[in] | NUM | The number of ODEs to integrate. This should be the size of the leading dimension of y_host and var_host . |
[in] | t_start | The system time |
[in] | t_end | The end time |
[in] | stepsize | The integration step size. If stepsize < 0, the step size will be set to t_end - t |
[in,out] | y_host | The state vectors to integrate. |
[in] | var_host | The parameters to use in dydt() and eval_jacob() |
Definition at line 161 of file solver_interface.cu.
__host__ void genericcu::check_error | ( | int | num_conditions, |
int * | code_arr | ||
) |
Definition at line 15 of file radau2a_props.cu.
void genericcu::cleanup_solver | ( | solver_memory ** | , |
solver_memory ** | |||
) |
void genericcu::init_solver_log | ( | ) |
Initializes solver specific items for logging.
Initializes stepsize logging for stiffness measurement
Initializes solver specific items for logging.
Initializes the Krylov subspace logging files (if LOG_OUTPUT is defined)
Definition at line 190 of file cvodes_init.c.
void genericcu::initialize_solver | ( | const int | , |
solver_memory ** | , | ||
solver_memory ** | |||
) |
__global__ void genericcu::intDriver | ( | const int | NUM, |
const double | t, | ||
const double | t_end, | ||
const double *__restrict__ | pr_global, | ||
double *__restrict__ | y_global, | ||
const mechanism_memory *__restrict__ | d_mem, | ||
const solver_memory *__restrict__ | s_mem | ||
) |
Generic driver for the GPU integrators.
[in] | NUM | The (non-padded) number of IVPs to integrate |
[in] | t | The current system time |
[in] | t_end | The IVP integration end time |
[in] | pr_global | The system constant variable (pressures / densities) |
[in,out] | y_global | The system state vectors at time t. Returns system state vectors at time t_end |
[in] | d_mem | The mechanism_memory struct that contains the pre-allocated memory for the RHS \ Jacobian evaluation |
[in] | s_mem | The solver_memory struct that contains the pre-allocated memory for the solver |
Definition at line 29 of file solver_generic.cu.
__device__ void genericcu::integrate | ( | const double | , |
const double | , | ||
const double | , | ||
double *const | __restrict__, | ||
mechanism_memory const *const | __restrict__, | ||
solver_memory const *const | __restrict__ | ||
) |
|
inline |
A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions.
[out] | dst | The destination array |
[in] | pitch_dst | The width (in bytes) of the destination array. This corresponds to the padded number of IVPs to be solved. |
[in] | src | The source pointer |
[in] | pitch_src | The width (in bytes) of the source array. This corresponds to the (non-padded) number of IVPs read by read_initial_conditions |
[in] | offset | The offset within the source array (IVP index) to copy from. This is useful in the case (for large models) where the solver and state vector memory will not fit in device memory and the integration must be split into multiple kernel calls. |
[in] | width | The size (in bytes) of memory to copy for each entry in the state vector |
[in] | height | The number of entries in the state vector |
Definition at line 46 of file solver_interface.cu.
|
inline |
A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions.
[out] | dst | The destination array |
[in] | pitch_dst | The width (in bytes) of the source array. This corresponds to the (non-padded) number of IVPs read by read_initial_conditions |
[in] | src | The source pointer |
[in] | pitch_src | The width (in bytes) of the destination array. This corresponds to the padded number of IVPs to be solved. |
[in] | offset | The offset within the destination array (IVP index) to copy to. This is useful in the case (for large models) where the solver and state vector memory will not fit in device memory and the integration must be split into multiple kernel calls. |
[in] | width | The size (in bytes) of memory to copy for each entry in the state vector |
[in] | height | The number of entries in the state vector |
Definition at line 72 of file solver_interface.cu.
size_t genericcu::required_solver_size | ( | ) |
Returns the total size (in bytes) required for memory storage for a single GPU thread Used in calculation of the maximum number of possible GPU threads to launch, this method returns the size of the solver_memory structure (per-GPU thread)
Definition at line 167 of file exp4_init.cu.
void genericcu::solver_log | ( | ) |
Executes solver specific logging tasks.
Logs errors, step-sizes, and krylov subspace size (if LOG_OUTPUT is defined)
Definition at line 192 of file cvodes_init.c.
const char* genericcu::solver_name | ( | ) |
Returns a descriptive solver name.
Definition at line 181 of file cvodes_init.c.
mechanism_memory * genericcu::device_mech |
Definition at line 22 of file solver_interface.cu.
solver_memory * genericcu::device_solver |
Definition at line 20 of file solver_interface.cu.
dim3 genericcu::dimBlock |
block and grid sizes
Definition at line 24 of file solver_interface.cu.
dim3 genericcu::dimGrid |
Definition at line 24 of file solver_interface.cu.
mechanism_memory* genericcu::host_mech |
The mechanism memory structs.
Definition at line 22 of file solver_interface.cu.
solver_memory* genericcu::host_solver |
The solver memory structs.
Definition at line 20 of file solver_interface.cu.
int genericcu::padded |
Padded # of ODEs to solve.
Definition at line 18 of file solver_interface.cu.
int* genericcu::result_flag |
result flag
Definition at line 26 of file solver_interface.cu.
double* genericcu::y_temp |
temorary storage
Definition at line 28 of file solver_interface.cu.