import re


def process_gpu_sycl(stdout, column):
    """ Process the stdout of the SYCLBLAS papre benchmarks.
        stdout is a string containing multiple lines.
    Example output:

    t_copy , 0.000486338, 0.000144124, 9.4301e-05, 6.7637e-05
    t_axpy , 0.000449574, 0.000166723, 0.000120264, 9.2823e-05
    t_add  , 0.000529654, 0.000364608, 0.00034186, 0.0002719
    """
    headers = []
    values = {}
    lines = stdout.splitlines(True)
    for l in lines:
        # Field Delimiter
        fd = "\s*,\s*"
        p = re.compile("(?P<name>t_[A-Za-z]+)" + fd + "(?P<first>[0-9]+\.[0-9]+e?-?[0-9]*)"
                        + fd + "(?P<normal>[0-9]+\.[0-9]+e?-?[0-9]*)"
                        + fd + "(?P<twofold>[0-9]+\.[0-9]+e?-?[0-9]*)"
                        + fd + "(?P<fourfold>[0-9]+\.[0-9]+e?-?[0-9]*).*");
        m = p.match(l)
        if m:
            values[m.group("name")] = m.group(column);

    return values