2015-12-04 15:47:52 +01:00
|
|
|
/**
|
2016-09-11 22:20:15 +02:00
|
|
|
* Author......: See docs/credits.txt
|
2015-12-04 15:47:52 +01:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
2016-05-25 23:04:26 +02:00
|
|
|
#include "inc_vendor.cl"
|
|
|
|
#include "inc_types.cl"
|
2017-07-13 15:03:26 +02:00
|
|
|
#include "inc_common.cl"
|
2015-12-04 15:47:52 +01:00
|
|
|
|
2017-08-25 17:52:55 +02:00
|
|
|
__kernel void amp (__global pw_t *pws, __global pw_t *pws_amp, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, const u32 combs_mode, const u64 gid_max)
|
2015-12-04 15:47:52 +01:00
|
|
|
{
|
2017-08-19 16:39:22 +02:00
|
|
|
const u64 gid = get_global_id (0);
|
2015-12-04 15:47:52 +01:00
|
|
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
2018-02-05 17:18:58 +01:00
|
|
|
pw_t pw = pws_amp[gid];
|
2015-12-04 15:47:52 +01:00
|
|
|
|
2017-06-25 00:56:25 +02:00
|
|
|
pw_t comb = combs_buf[0];
|
2015-12-04 15:47:52 +01:00
|
|
|
|
2017-06-25 00:42:53 +02:00
|
|
|
const u32 pw_len = pw.pw_len;
|
2015-12-04 15:47:52 +01:00
|
|
|
|
2017-06-25 00:42:53 +02:00
|
|
|
const u32 comb_len = comb.pw_len;
|
2015-12-04 15:47:52 +01:00
|
|
|
|
|
|
|
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
|
|
|
{
|
2017-07-02 15:29:04 +02:00
|
|
|
switch_buffer_by_offset_1x64_le_S (comb.i, pw_len);
|
2015-12-04 15:47:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
|
|
|
|
{
|
2017-07-02 15:29:04 +02:00
|
|
|
switch_buffer_by_offset_1x64_le_S (pw.i, comb_len);
|
2015-12-04 15:47:52 +01:00
|
|
|
}
|
|
|
|
|
2017-06-25 00:42:53 +02:00
|
|
|
#pragma unroll
|
|
|
|
for (int i = 0; i < 64; i++)
|
|
|
|
{
|
|
|
|
pw.i[i] |= comb.i[i];
|
|
|
|
}
|
2015-12-04 15:47:52 +01:00
|
|
|
|
2017-06-25 00:42:53 +02:00
|
|
|
pw.pw_len = pw_len + comb_len;
|
2015-12-04 15:47:52 +01:00
|
|
|
|
2018-02-05 17:18:58 +01:00
|
|
|
pws[gid] = pw;
|
2015-12-04 15:47:52 +01:00
|
|
|
}
|