bkloppenborg / liboi

OpenCL Interferometry Library
https://github.com/bkloppenborg/liboi/wiki
GNU Lesser General Public License v3.0
5 stars 6 forks source link

Implement a plan interface for the library #24

Open bkloppenborg opened 11 years ago

bkloppenborg commented 11 years ago

In order to be easy to use, it would be best for the programmer to be able to define a "plan" of execution. The plan should:

1) Be a vector of CRoutine* objects. 2) Handle routine (re)allocation, initialization, and destruction. 3) Detect if a plan is being executed. 4) Terminate a plan during execution?

LIBOI should be modified to accept plan objects and execute the plan as instructed. This gives the programmer maximum flexibility as to what a plan should do. The plans could be invoked by:

CLibOI::run(plan, data_num, output, n):
    for routine in plan:
        switch(routine.id):
            ...

As the routines allocate and manage their own memory internally, the remaining memory (mostly buffers) could either be managed by the plan or by CLibOI.

bkloppenborg commented 11 years ago

This objective can be accomplished by creating a factory class for routines and letting liboi execute a list of routines. Memory allocation will have to be routine-managed and/or use well-defined buffers for input/output.