1 // Definitions common to CPU and GPU . Do NOT put structures here or 2 // make any use of of long long without paying attention to alignment 3 // issues! 4 5 #ifndef COMMON_H 6 #define COMMON_H 7 8 #define TRUE 1 9 #define FALSE 0 10 11 12 // GGRIII: If you like having hair (on your head, not in clumps, in your 13 // hands), then the following parens are pretty important 14 #define KILOBYTE 1024 15 #define MEGABYTE (1024 * KILOBYTE) 16 #define GIGABYTE (1024 * MEGABYTE) 17 #define TERABYTE (1024 * GIGABYTE) 18 #define PETABYTE (1024 * TERABYTE) 19 #define EXABYTE (1024 * PETABYTE) 20 21 // SIZE_OF_BUFFER indicates how much data to read from an image file 22 // at a time. This size should be a multiple of the maximum cluster size 23 // that Scalpel will encounter if "quick" mode is ever used. 24 #define SIZE_OF_BUFFER (10 * MEGABYTE) 25 26 // The maximum number of patterns of the maximal length the GPU will currently 27 // support. Requires statically allocated structures. 28 #define MAX_PATTERNS 1024 29 #define MAX_PATTERN_LENGTH 20 30 31 #define PATTERN_CASESEN (MAX_PATTERN_LENGTH - 1) 32 #define PATTERN_WCSHIFT (MAX_PATTERN_LENGTH - 2) 33 34 // Size of the header / footer lookup tables, and the end marker for each row. 35 #define LOOKUP_ROWS 256 36 #define LOOKUP_COLUMNS 16 37 #define LOOKUP_ENDOFROW 127 38 39 // Number of threads per block to execute on the GPU. 40 // Do not change me unless you REALLY know what you're doing! 41 // Probably still don't. 42 #define THREADS_PER_BLOCK 256 43 44 // The maximum number if header + footer matches supported for finding on 45 // each block of data of size THREADS_PER_BLOCK. 46 #define MAX_RESULTS_PER_BLOCK 120 // 16 is definitely too small 47 48 // Results are encoded as header / footer index (byte) followed by the index 49 // where the header / footer was found in the block (byte). 50 #define RESULTS_SIZE_PER_BLOCK (MAX_RESULTS_PER_BLOCK*2) 51 52 #endif // COMMON_H 53