Polynomial Evaluation and Differentiation (PED) in PHCv2.3.34

This directory contains experimental code to evaluate and differentiate
polynomial systems via reduction to the Speelpenning example.
The "PED" stands for Polynomial Evaluation and Differentiation.

Jan Verschelde and Genady Yoffe:
"Evaluating polynomials in several variables and their derivatives on
 a GPU computing processor."
In the Proceedings of the 2012 IEEE 26th International Parallel and
Distributed Processing Symposium Workshops, 21-25 May 2012, Shanghai China,
pages 1391-1399. IEEE Computer Society, 2012.

The are two versions of the code:
(1) CPU (the host) for correctness comparison and speedup of timings.
(2) GPU for acceleration to compensate for multiprecision arithmetic.
The multiprecision arithmetic is provided by the QD library on the CPU,
and the GQD library on the GPU.

The code is written in C++ with the use of templates for the precision,
as defined by the DefineType.h in the directories DefineTypes*.

The makefile defines the location of the installed QD and GQD libraries.
Type "make" to compile all programs and "make clean" to remove object files
and the executable programs.
The code works for double, double double, quad double arithmetic,
and runs as run_ped_d, run_ped_dd, and run_ped_qd respectively.

To prepare for version 2.4.34 of PHCpack, to the three separate run_
programs, a new test_ped program was developed.
This test_ped takes the precision as its first command line argument.

------------------------------------------------------------------------------
file name          : short description
------------------------------------------------------------------------------
run_ped.cpp        : main program
DefineType.h       : defines the precision in the respective directories
                     DefineTypesD, DefineTypesDD, and DefineTypesQD, for
                     double, double double, and quad double precision
ped_kernelsT.cu    : kernels of the GPU solver
ped_kernelsT_qd.cu : kernels of the GPU solver for quad double precision
------------------------------------------------------------------------------
complexD.h         : complex types for GPU (D = device)
complexH.h         : complex types for CPU (H = host)
gqd_qd_util.h      : headers of type conversions and command line parsing
gqd_qd_util.cpp    : definitions of type conversions and command line parsing
------------------------------------------------------------------------------
ped_host.h         : prototypes for execution on the host
ped_host.cpp       : definition of the functions for the host
ped_kernels.h      : prototypes for the new kernels
ped_kernels.cu     : definition of the new kernels
ped_kernels_qd.cu  : definition of the new kernels for qd
all_ped_kernels.cu : code for all kernels, for all three precisions
test_ped.cpp       : main test which takes the precision at the command line
------------------------------------------------------------------------------

After successful compilation, the program requires several
command line arguments, integer values BS, dim, NM, NV, degr, and r:

1. BS   : block size
2. dim  : dimension
3. NM   : number of monomials
4. NV   : number of variables
5. degr : largest degree of every variable
6. r    : number of repeated computations
7. mode : running mode: 0 GPU, 1 CPU, or 2 GPU/CPU

For example, at the command prompt, type
./run_ped_dd 32 32 1024 9 2 1 2
to verify the correctness.

For test_ped, the first parameter 0 (in addition to the 7 from above) is
the precision, 0 for double, 1 for double double, and 2 for quad double.
For example, to verify the correctness in quad double precision, type
./test_ped 2 32 32 1024 3 4 1 2
at the command prompt.
