Move all bitmap related host code into bitmap.c

This commit is contained in:
jsteube
2016-09-22 16:23:36 +02:00
parent 095dfdc730
commit b6f966970b
9 changed files with 187 additions and 147 deletions
+2 -1
View File
@@ -10,6 +10,7 @@
int sort_by_bitmap (const void *s1, const void *s2);
uint generate_bitmaps (const uint digests_cnt, const uint dgst_size, const uint dgst_shifts, char *digests_buf_ptr, const uint dgst_pos0, const uint dgst_pos1, const uint dgst_pos2, const uint dgst_pos3, const uint bitmap_mask, const uint bitmap_size, uint *bitmap_a, uint *bitmap_b, uint *bitmap_c, uint *bitmap_d, const u64 collisions_max);
void bitmap_ctx_init (bitmap_ctx_t *bitmap_ctx, const user_options_t *user_options, const hashconfig_t *hashconfig, const hashes_t *hashes);
void bitmap_ctx_destroy (bitmap_ctx_t *bitmap_ctx);
#endif // _BITMAP_H
+1 -1
View File
@@ -91,7 +91,7 @@ void opencl_ctx_destroy (opencl_ctx_t *opencl_ctx);
int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const tuning_db_t *tuning_db, const user_options_t *user_options, const uint algorithm_pos);
void opencl_ctx_devices_destroy (opencl_ctx_t *opencl_ctx);
int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const session_ctx_t *session_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const folder_config_t *folder_config);
int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const session_ctx_t *session_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const folder_config_t *folder_config, const bitmap_ctx_t *bitmap_ctx);
int opencl_session_destroy (opencl_ctx_t *opencl_ctx);
#endif // _OPENCL_H
+1 -1
View File
@@ -6,7 +6,7 @@
#ifndef _SESSION_H
#define _SESSION_H
void session_ctx_init (session_ctx_t *session_ctx, const u32 kernel_rules_cnt, kernel_rule_t *kernel_rules_buf, const u32 bitmap_size, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, u32 *bitmap_s1_a, u32 *bitmap_s1_b, u32 *bitmap_s1_c, u32 *bitmap_s1_d, u32 *bitmap_s2_a, u32 *bitmap_s2_b, u32 *bitmap_s2_c, u32 *bitmap_s2_d);
void session_ctx_init (session_ctx_t *session_ctx, const u32 kernel_rules_cnt, kernel_rule_t *kernel_rules_buf);
void session_ctx_destroy (session_ctx_t *session_ctx);
+21 -14
View File
@@ -859,22 +859,28 @@ typedef struct
u32 kernel_rules_cnt;
kernel_rule_t *kernel_rules_buf;
u32 bitmap_size;
u32 bitmap_mask;
u32 bitmap_shift1;
u32 bitmap_shift2;
u32 *bitmap_s1_a;
u32 *bitmap_s1_b;
u32 *bitmap_s1_c;
u32 *bitmap_s1_d;
u32 *bitmap_s2_a;
u32 *bitmap_s2_b;
u32 *bitmap_s2_c;
u32 *bitmap_s2_d;
} session_ctx_t;
typedef struct
{
u32 bitmap_bits;
u32 bitmap_nums;
u32 bitmap_size;
u32 bitmap_mask;
u32 bitmap_shift1;
u32 bitmap_shift2;
u32 *bitmap_s1_a;
u32 *bitmap_s1_b;
u32 *bitmap_s1_c;
u32 *bitmap_s1_d;
u32 *bitmap_s2_a;
u32 *bitmap_s2_b;
u32 *bitmap_s2_c;
u32 *bitmap_s2_d;
} bitmap_ctx_t;
typedef struct
{
char *cwd;
@@ -974,6 +980,7 @@ typedef struct
loopback_ctx_t *loopback_ctx;
debugfile_ctx_t *debugfile_ctx;
session_ctx_t *session_ctx;
bitmap_ctx_t *bitmap_ctx;
/**
* used for restore