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
|
|
|
|
*/
|
|
|
|
|
2016-05-25 21:04:26 +00:00
|
|
|
#include "inc_vendor.cl"
|
|
|
|
#include "inc_types.cl"
|
2017-07-13 13:03:26 +00:00
|
|
|
#include "inc_common.cl"
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2017-06-24 22:56:25 +00: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 u32 gid_max)
|
2015-12-04 14:47:52 +00:00
|
|
|
{
|
|
|
|
const u32 gid = get_global_id (0);
|
|
|
|
|
|
|
|
if (gid >= gid_max) return;
|
|
|
|
|
2017-06-24 22:42:53 +00:00
|
|
|
pw_t pw = pws[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
|
|
|
|
2017-06-24 22:42:53 +00:00
|
|
|
pws_amp[gid] = pw;
|
2015-12-04 14:47:52 +00:00
|
|
|
}
|