Start cleaning up to prepare for the reduce stage.
This commit is contained in:
parent
95ca0c519b
commit
f4ad81c8cc
4 changed files with 16 additions and 3 deletions
|
@ -45,7 +45,7 @@ SEXP CCubes(SEXP tt) {
|
||||||
double elapsed_time;
|
double elapsed_time;
|
||||||
|
|
||||||
config_set_int("log", LOG_LEVEL_WARN);
|
config_set_int("log", LOG_LEVEL_WARN);
|
||||||
config_set_int("log:clccubes", LOG_LEVEL_WARN);
|
config_set_int("log:clccubes", LOG_LEVEL_DEBUG);
|
||||||
config_set_int("log:ccubes", LOG_LEVEL_DEBUG);
|
config_set_int("log:ccubes", LOG_LEVEL_DEBUG);
|
||||||
config_set_int("log:cl", LOG_LEVEL_DEBUG);
|
config_set_int("log:cl", LOG_LEVEL_DEBUG);
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ SEXP CCubes(SEXP tt) {
|
||||||
int current_batch = n_tasks < n_tasks_batch ? n_tasks : n_tasks_batch;
|
int current_batch = n_tasks < n_tasks_batch ? n_tasks : n_tasks_batch;
|
||||||
|
|
||||||
log_debug("ccubes", "Tasks %d - %d out of %d",
|
log_debug("ccubes", "Tasks %d - %d out of %d",
|
||||||
task, task + current_batch, current_batch);
|
task, task + current_batch - 1, n_tasks);
|
||||||
|
|
||||||
bool *coverage;
|
bool *coverage;
|
||||||
unsigned int *fixed_bits;
|
unsigned int *fixed_bits;
|
||||||
|
@ -267,7 +267,9 @@ SEXP CCubes(SEXP tt) {
|
||||||
}
|
}
|
||||||
log_debug_raw("ccubes", "\n");
|
log_debug_raw("ccubes", "\n");
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
/* change to something less aggresive for reuse */
|
||||||
|
ccubes_clean_up(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
|
|
|
@ -225,6 +225,7 @@ cl_init(struct cl_uctx *puctx)
|
||||||
/*
|
/*
|
||||||
* CPU
|
* CPU
|
||||||
*/
|
*/
|
||||||
|
puctx->cpu_queue = NULL;
|
||||||
#if 0
|
#if 0
|
||||||
puctx->cpu_queue = clCreateCommandQueue(ctx, devices[1], 0,
|
puctx->cpu_queue = clCreateCommandQueue(ctx, devices[1], 0,
|
||||||
&result);
|
&result);
|
||||||
|
|
|
@ -484,8 +484,10 @@ void
|
||||||
ccubes_clean_up(struct ccubes_context *ctx)
|
ccubes_clean_up(struct ccubes_context *ctx)
|
||||||
{
|
{
|
||||||
clReleaseProgram(ctx->ccubes_program);
|
clReleaseProgram(ctx->ccubes_program);
|
||||||
|
log_debug("clccubes", "clReleaseProgram ccubes_program");
|
||||||
|
|
||||||
ccubes_unmap(ctx);
|
ccubes_unmap(ctx);
|
||||||
|
log_debug("clccubes", "ccubes_unmap");
|
||||||
|
|
||||||
/* INPUTS */
|
/* INPUTS */
|
||||||
clReleaseMemObject(ctx->nofvalues);
|
clReleaseMemObject(ctx->nofvalues);
|
||||||
|
@ -496,14 +498,19 @@ ccubes_clean_up(struct ccubes_context *ctx)
|
||||||
clReleaseMemObject(ctx->last_index);
|
clReleaseMemObject(ctx->last_index);
|
||||||
clReleaseMemObject(ctx->p_covered);
|
clReleaseMemObject(ctx->p_covered);
|
||||||
clReleaseMemObject(ctx->p_pichart_pos);
|
clReleaseMemObject(ctx->p_pichart_pos);
|
||||||
|
log_debug("clccubes", "clReleaseMemObject INPUTS");
|
||||||
|
|
||||||
/* OUTPUTS */
|
/* OUTPUTS */
|
||||||
clReleaseMemObject(ctx->coverage);
|
clReleaseMemObject(ctx->coverage);
|
||||||
clReleaseMemObject(ctx->fixed_bits);
|
clReleaseMemObject(ctx->fixed_bits);
|
||||||
clReleaseMemObject(ctx->value_bits);
|
clReleaseMemObject(ctx->value_bits);
|
||||||
clReleaseMemObject(ctx->pichart_values);
|
clReleaseMemObject(ctx->pichart_values);
|
||||||
|
log_debug("clccubes", "clReleaseMemObject OUTPUTS");
|
||||||
|
|
||||||
cl_clean_up(*ctx->clctx);
|
cl_clean_up(*ctx->clctx);
|
||||||
|
log_debug("clccubes", "cl_clean_up");
|
||||||
|
|
||||||
|
free(ctx);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,4 +98,7 @@ ccubes_do_tasks(int n_tasks,
|
||||||
unsigned int *pichart_values /* OUT: RW */
|
unsigned int *pichart_values /* OUT: RW */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void
|
||||||
|
ccubes_clean_up(struct ccubes_context *ctx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue