Manish Agrawal


Week 4

23 Jun 2019 »

GSoC 2019 :: gprMax Weekly Documentation

Week 4

Elementwise Kernel Execution

PyOpenCl has an inbuilt feature of kernel execution in a parallel fashion. It allows to build kernels that evalutate mutli-stage expressions on one or more operands in a single and efficient pass which avoids the creation of temporary results that reduce the overall throughput.

pyopencl.elementwise.ElementwiseKernel() takes context, string formatted as a C argument list, snippet of C for mapping operation, function name and any preamble as arguments. A separate common.cl file is written which will be taken as preamble. All the macors which are defined for converting the global index into multi-dimensional formats as well as initialization of updatecoeffsE/H are defined in common.cl itself.

Model Testing

gprMax has testing module test_models.py which can compare the results with already available outputs for same input files. Divided into three types, there are basic, advanced and pmls testing modules.

For easy usage, argparser was added to the module so that specific models can be run on a single go. Our implementation for OpenCl are also tested with this testing module. There is further scope of enriching the test module with more test models and comparing techniques.

At the end of Week-4, my implementation for Elementwise kernel building model was integrated to gprMax ( #211 ).