2015-12-04 14:47:52 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2015-12-04 14:47:52 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
2019-03-22 14:16:25 +00:00
|
|
|
#ifdef KERNEL_STATIC
|
2019-03-21 22:00:38 +00:00
|
|
|
#include "inc_vendor.h"
|
|
|
|
#include "inc_types.h"
|
2019-04-26 11:59:43 +00:00
|
|
|
#include "inc_platform.cl"
|
2017-07-13 13:03:26 +00:00
|
|
|
#include "inc_common.cl"
|
2019-03-22 14:16:25 +00:00
|
|
|
#endif
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2019-03-25 11:24:04 +00:00
|
|
|
KERNEL_FQ void amp (GLOBAL_AS pw_t *pws, GLOBAL_AS pw_t *pws_amp, GLOBAL_AS const kernel_rule_t *rules_buf, GLOBAL_AS const pw_t *combs_buf, GLOBAL_AS const bf_t *bfs_buf, const u32 combs_mode, const u64 gid_max)
|
2015-12-04 14:47:52 +00:00
|
|
|
{
|
2017-08-19 14:39:22 +00:00
|
|
|
const u64 gid = get_global_id (0);
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
2018-02-05 16:18:58 +00:00
|
|
|
pw_t pw = pws_amp[gid];
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2017-06-24 22:56:25 +00:00
|
|
|
pw_t comb = combs_buf[0];
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2017-06-24 22:42:53 +00:00
|
|
|
const u32 pw_len = pw.pw_len;
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2017-06-24 22:42:53 +00:00
|
|
|
const u32 comb_len = comb.pw_len;
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
|
|
|
{
|
2017-07-02 13:29:04 +00:00
|
|
|
switch_buffer_by_offset_1x64_le_S (comb.i, pw_len);
|
2015-12-04 14:47:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
|
|
|
|
{
|
2017-07-02 13:29:04 +00:00
|
|
|
switch_buffer_by_offset_1x64_le_S (pw.i, comb_len);
|
2015-12-04 14:47:52 +00:00
|
|
|
}
|
|
|
|
|
2020-03-04 12:30:09 +00:00
|
|
|
pw.i[ 0] |= comb.i[ 0];
|
|
|
|
pw.i[ 1] |= comb.i[ 1];
|
|
|
|
pw.i[ 2] |= comb.i[ 2];
|
|
|
|
pw.i[ 3] |= comb.i[ 3];
|
|
|
|
pw.i[ 4] |= comb.i[ 4];
|
|
|
|
pw.i[ 5] |= comb.i[ 5];
|
|
|
|
pw.i[ 6] |= comb.i[ 6];
|
|
|
|
pw.i[ 7] |= comb.i[ 7];
|
|
|
|
pw.i[ 8] |= comb.i[ 8];
|
|
|
|
pw.i[ 9] |= comb.i[ 9];
|
|
|
|
pw.i[10] |= comb.i[10];
|
|
|
|
pw.i[11] |= comb.i[11];
|
|
|
|
pw.i[12] |= comb.i[12];
|
|
|
|
pw.i[13] |= comb.i[13];
|
|
|
|
pw.i[14] |= comb.i[14];
|
|
|
|
pw.i[15] |= comb.i[15];
|
|
|
|
pw.i[16] |= comb.i[16];
|
|
|
|
pw.i[17] |= comb.i[17];
|
|
|
|
pw.i[18] |= comb.i[18];
|
|
|
|
pw.i[19] |= comb.i[19];
|
|
|
|
pw.i[20] |= comb.i[20];
|
|
|
|
pw.i[21] |= comb.i[21];
|
|
|
|
pw.i[22] |= comb.i[22];
|
|
|
|
pw.i[23] |= comb.i[23];
|
|
|
|
pw.i[24] |= comb.i[24];
|
|
|
|
pw.i[25] |= comb.i[25];
|
|
|
|
pw.i[26] |= comb.i[26];
|
|
|
|
pw.i[27] |= comb.i[27];
|
|
|
|
pw.i[28] |= comb.i[28];
|
|
|
|
pw.i[29] |= comb.i[29];
|
|
|
|
pw.i[30] |= comb.i[30];
|
|
|
|
pw.i[31] |= comb.i[31];
|
|
|
|
pw.i[32] |= comb.i[32];
|
|
|
|
pw.i[33] |= comb.i[33];
|
|
|
|
pw.i[34] |= comb.i[34];
|
|
|
|
pw.i[35] |= comb.i[35];
|
|
|
|
pw.i[36] |= comb.i[36];
|
|
|
|
pw.i[37] |= comb.i[37];
|
|
|
|
pw.i[38] |= comb.i[38];
|
|
|
|
pw.i[39] |= comb.i[39];
|
|
|
|
pw.i[40] |= comb.i[40];
|
|
|
|
pw.i[41] |= comb.i[41];
|
|
|
|
pw.i[42] |= comb.i[42];
|
|
|
|
pw.i[43] |= comb.i[43];
|
|
|
|
pw.i[44] |= comb.i[44];
|
|
|
|
pw.i[45] |= comb.i[45];
|
|
|
|
pw.i[46] |= comb.i[46];
|
|
|
|
pw.i[47] |= comb.i[47];
|
|
|
|
pw.i[48] |= comb.i[48];
|
|
|
|
pw.i[49] |= comb.i[49];
|
|
|
|
pw.i[50] |= comb.i[50];
|
|
|
|
pw.i[51] |= comb.i[51];
|
|
|
|
pw.i[52] |= comb.i[52];
|
|
|
|
pw.i[53] |= comb.i[53];
|
|
|
|
pw.i[54] |= comb.i[54];
|
|
|
|
pw.i[55] |= comb.i[55];
|
|
|
|
pw.i[56] |= comb.i[56];
|
|
|
|
pw.i[57] |= comb.i[57];
|
|
|
|
pw.i[58] |= comb.i[58];
|
|
|
|
pw.i[59] |= comb.i[59];
|
|
|
|
pw.i[60] |= comb.i[60];
|
|
|
|
pw.i[61] |= comb.i[61];
|
|
|
|
pw.i[62] |= comb.i[62];
|
|
|
|
pw.i[63] |= comb.i[63];
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2017-06-24 22:42:53 +00:00
|
|
|
pw.pw_len = pw_len + comb_len;
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2018-02-05 16:18:58 +00:00
|
|
|
pws[gid] = pw;
|
2015-12-04 14:47:52 +00:00
|
|
|
}
|