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"
|
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
|
|
|
|
2018-11-21 12:00:30 +00:00
|
|
|
__kernel void amp (__global pw_t * restrict pws, __global pw_t * restrict pws_amp, __global const kernel_rule_t * restrict rules_buf, __global const pw_t * restrict combs_buf, __global const bf_t * restrict 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
|
|
|
}
|
|
|
|
|
2017-06-24 22:42:53 +00:00
|
|
|
#pragma unroll
|
|
|
|
for (int i = 0; i < 64; i++)
|
|
|
|
{
|
|
|
|
pw.i[i] |= comb.i[i];
|
|
|
|
}
|
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
|
|
|
}
|