<commit_before>/*
 * function: kernel_demosaic
 * input:    image2d_t as read only
 * output:   image2d_t as write only
 */

"__kernel void kernel_demosaic (__read_only image2d_t input, __write_only image2d_t output)    "
"{                                                                                             "
"    int x = 2 * get_global_id (0);                                                            "
"    int y = 2 * get_global_id (1);                                                            "
"    sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;  "
//"    sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;  "

"                                                                                              "
"    int x0 = x - 1;                                                                           "
"    int y0 = y - 1;                                                                           "
"    float4 p[16];                                                                             "
"    for (int i = 0; i < 16; ++i) {                                                            "
"        p[i] = read_imagef (input, sampler, (int2)(x0 + i % 4, y0 + i / 4));                  "
"        p[i].x *= 64.0;                                                                       "
"    }                                                                                         "
"                                                                                              "
"    float4 p00, p01, p10, p11;                                                                "
"    p00.x = (p[4].x + p[6].x) / 2.0;                                                          "
"    p00.y = (p[5].x * 4 + p[0].x + p[2].x + p[8].x + p[10].x) / 8.0;                          "
"    p00.z = (p[1].x + p[9].x) / 2.0;                                                          "
"    p01.x = p[6].x;                                                                           "
"    p01.y = (p[2].x + p[5].x + p[7].x+ p[10].x) / 4.0;                                        "
"    p01.z = (p[1].x + p[3].x + p[9].x+ p[11].x) / 4.0;                                        "
"    p10.x = (p[4].x + p[6].x + p[12].x+ p[14].x) / 4.0;                                       "
"    p10.y = (p[5].x + p[8].x + p[10].x+ p[13].x) / 4.0;                                       "
"    p10.z = p[9].x;                                                                           "
"    p11.x = (p[6].x + p[14].x) / 2.0;                                                         "
"    p11.y = (p[10].x * 4 + p[5].x + p[7].x + p[13].x + p[15].x) / 8.0;                        "
"    p11.z = (p[9].x + p[11].x) / 2.0;                                                         "
"                                                                                              "
"    write_imagef (output, (int2)(x, y), p00);                                                 "
"    write_imagef (output, (int2)(x + 1, y), p01);                                             "
"    write_imagef (output, (int2)(x, y + 1), p10);                                             "
"    write_imagef (output, (int2)(x + 1, y + 1), p10);                                         "
"}                                                                                             "
<commit_msg>cl demosaic: fix kernel typo and move 10 to 16 bits<commit_after>/*
 * function: kernel_demosaic
 * input:    image2d_t as read only
 * output:   image2d_t as write only
 */

"__kernel void kernel_demosaic (__read_only image2d_t input, __write_only image2d_t output)    "
"{                                                                                             "
"    int x = 2 * get_global_id (0);                                                            "
"    int y = 2 * get_global_id (1);                                                            "
"    sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;  "
//"    sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;  "

"                                                                                              "
"    int x0 = x - 1;                                                                           "
"    int y0 = y - 1;                                                                           "
"    float4 p[16];                                                                             "
"    for (int i = 0; i < 16; ++i) {                                                            "
"        p[i] = read_imagef (input, sampler, (int2)(x0 + i % 4, y0 + i / 4));                  "
"    }                                                                                         "
"                                                                                              "
"    float4 p00, p01, p10, p11;                                                                "
"    p00.x = (p[4].x + p[6].x) / 2.0;                                                          "
"    p00.y = (p[5].x * 4 + p[0].x + p[2].x + p[8].x + p[10].x) / 8.0;                          "
"    p00.z = (p[1].x + p[9].x) / 2.0;                                                          "
"    p01.x = p[6].x;                                                                           "
"    p01.y = (p[2].x + p[5].x + p[7].x+ p[10].x) / 4.0;                                        "
"    p01.z = (p[1].x + p[3].x + p[9].x+ p[11].x) / 4.0;                                        "
"    p10.x = (p[4].x + p[6].x + p[12].x+ p[14].x) / 4.0;                                       "
"    p10.y = (p[5].x + p[8].x + p[10].x+ p[13].x) / 4.0;                                       "
"    p10.z = p[9].x;                                                                           "
"    p11.x = (p[6].x + p[14].x) / 2.0;                                                         "
"    p11.y = (p[10].x * 4 + p[5].x + p[7].x + p[13].x + p[15].x) / 8.0;                        "
"    p11.z = (p[9].x + p[11].x) / 2.0;                                                         "
"                                                                                              "
"    write_imagef (output, (int2)(x, y), p00);                                                 "
"    write_imagef (output, (int2)(x + 1, y), p01);                                             "
"    write_imagef (output, (int2)(x, y + 1), p10);                                             "
"    write_imagef (output, (int2)(x + 1, y + 1), p11);                                         "
"}                                                                                             "

{'fraction_non_alphanumeric': 0.11792245793708851, 'fraction_numerical': 0.042574981711777614, 'mean_word_length': 0.48254174799392757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 143, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6173087', 'n_tokens_mistral': 1813, 'n_tokens_neox': 1681, 'n_words': 328}