Core - module to manage the core data structures (and the Info for some reason)
Copyright (C) 2017-2018, Colin P Stark and Gavin J Stark. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @file core.ml * @brief Core data, Info, and Workflow handling *
The Info module provides name/value pairs, with the value being of a variant type permitting strings, ints and floats. The module is used to create the OpenCL compiler '#define' options.
module
Info : sig ... end
Core data structures and results, used throughout the processing stages.
type
t_core_data
=
{
properties : Properties.t_props; |
info : Info.t; |
mutable roi_nx :
int; |
mutable roi_ny :
int; |
mutable
roi_pixel_size : float; |
mutable roi_region
: float array; |
mutable pad_width :
int; |
mutable roi_array :
Globals.t_ba_floats; |
mutable
basin_fatmask_array : Globals.t_ba_chars; |
mutable
basin_mask_array : Globals.t_ba_chars; |
mutable
x_roi_n_pixel_centers : Globals.t_ba_floats; |
mutable
y_roi_n_pixel_centers : Globals.t_ba_floats; |
mutable u_array :
Globals.t_ba_floats; |
mutable v_array :
Globals.t_ba_floats; |
mutable seeds :
Globals.t_ba_floats; |
}
t_core_data
This is the data structure used to contain the data used throughout the processing stages.
The properties covers all the workflows; the info is built from those properties with some short-term adaptations (since it is used for OpenCL compiler options, which vary slightly on invocation).
The arrays are filled in by individual workflows; they are initialized to small arrays, before they are modified at the appropriate point in the workflow.
type
t_trace_results
=
{
mutable
streamline_arrays : bytes array array; |
traj_nsteps_array : Globals.t_ba_int16s; |
traj_lengths_array : Globals.t_ba_floats; |
slc_array : Globals.t_ba_ints; |
slt_array : Globals.t_ba_floats; |
sla_array : Globals.t_ba_floats; |
}
t_trace_results
The trace results are produced by the trace workflow, and are consumed by later workflow stages.
val create
: Properties.t_props
‑> t_core_data
create properties
Create the core data structure from the given properties, initializing arrays minimally.
val set_roi
: t_core_data
‑> int array ‑> unit
set_roi t roi
Allocate empty arrays for the Region-of-Interest