24 const char* name =
"exprb43-int-gpu";
37 __device__
int num_integrator_steps;
45 int num_integrator_steps_host;
60 cudaErrorCheck( cudaMemcpyFromSymbol(&num_integrator_steps_host, num_integrator_steps,
sizeof(
int)) );
61 if (num_integrator_steps_host == -1)
64 cudaErrorCheck( cudaMemcpyFromSymbol(err_log_host, err_log, num_integrator_steps_host *
sizeof(
double)) );
65 cudaErrorCheck( cudaMemcpyFromSymbol(m_log_host, m_log, num_integrator_steps_host *
sizeof(
int)) );
66 cudaErrorCheck( cudaMemcpyFromSymbol(m1_log_host, m1_log, num_integrator_steps_host *
sizeof(
int)) );
67 cudaErrorCheck( cudaMemcpyFromSymbol(m2_log_host, m2_log, num_integrator_steps_host *
sizeof(
int)) );
68 cudaErrorCheck( cudaMemcpyFromSymbol(t_log_host, t_log, num_integrator_steps_host *
sizeof(
double)) );
69 cudaErrorCheck( cudaMemcpyFromSymbol(h_log_host, h_log, num_integrator_steps_host *
sizeof(
double)) );
70 cudaErrorCheck( cudaMemcpyFromSymbol(reject_log_host, reject_log, num_integrator_steps_host *
sizeof(
bool)) );
72 for (
int i = 0; i < num_integrator_steps_host; ++i)
74 if (reject_log_host[i])
76 fprintf(rFile,
"%.15le\t%.15le\t%.15le\t%d\t%d\t%d\n", t_log_host[i], h_log_host[i], err_log_host[i], m_log_host[i], m1_log_host[i], m2_log_host[i]);
80 fprintf(logFile,
"%.15le\t%.15le\t%.15le\t%d\t%d\t%d\n", t_log_host[i], h_log_host[i], err_log_host[i], m_log_host[i], m1_log_host[i], m2_log_host[i]);
98 int len = strlen(f_name);
99 char out_name[len + 17];
100 sprintf(out_name,
"log/%s-kry-log.txt", f_name);
101 logFile = fopen(out_name,
"w");
103 char out_reject_name[len + 23];
104 sprintf(out_reject_name,
"log/%s-kry-reject.txt", f_name);
107 rFile = fopen(out_reject_name,
"w");
120 size_t num_bytes = 0;
122 num_bytes +=
NSP *
sizeof(double);
124 num_bytes += 3 *
STRIDE *
sizeof(double);
126 num_bytes +=
NSP *
sizeof(double);
130 num_bytes +=
NSP *
STRIDE *
sizeof(double);
132 num_bytes += 5 *
NSP *
sizeof(double);
134 num_bytes +=
STRIDE *
sizeof(int);
138 num_bytes +=
STRIDE *
sizeof(cuDoubleComplex);
140 num_bytes += 1 *
sizeof(int);
Defines some simple macros to simplify GPU indexing.
void createAndZero(void **ptr, size_t size)
Convienvience method to Cuda Malloc and memset a pointer to zero.
int padded
Padded # of ODEs to solve.
void initialize_solver(int padded, solver_memory **h_mem, solver_memory **d_mem)
Initializes the GPU solver.
void init_solver_log()
Initializes solver specific items for logging.
#define STRIDE
the matrix dimensions
#define MAX_STEPS
Maximum allowed internal timesteps per integration step.
The generic initialization file for poles/hosts for RA based evaulation of the matrix exponential...
simple convenience file to include the correct solver properties file
void find_poles_and_residuals()
get poles and residues for rational approximant to matrix exponential
void solver_log()
Executes solver specific logging tasks.
#define cudaErrorCheck(ans)
const char * solver_name()
Returns a descriptive solver name.
void cleanup_solver(solver_memory **h_mem, solver_memory **d_mem)
Cleans up solver memory.
A file generated by Scons that specifies various options to the solvers.
size_t required_solver_size()
Returns the total size (in bytes) required for memory storage for a single GPU thread Used in calcula...