1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-21 22:18:44 +00:00
hashcat/OpenCL/inc_shared.h
Gabriele Gristina 867b3d4df1
Fixed bug in inc_rp_optimized.cl on Apple Intel with Metal
Fixed old/critical bug on Apple Intel with Metal by patching inc_rp_optimized.cl.
Tested on Apple Intel and Silicon with Metal/OpenCL and on Linux with CUDA, HIP, OpenCL GPU/CPU

Metal Backend: parallelize pipeline state object (PSO) compilation internally

Set unexported setting, setShouldMaximizeConcurrentCompilation, to boost kernel build process on Apple Metal (only >= 3)
2025-07-14 00:25:58 +02:00

69 lines
2.1 KiB
C

/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef INC_SHARED_H
#define INC_SHARED_H
#ifdef IS_METAL
#define KERN_ATTR_GPU_DECOMPRESS \
GLOBAL_AS pw_idx_t *pws_idx, \
GLOBAL_AS u32 *pws_comp, \
GLOBAL_AS pw_t *pws_buf, \
CONSTANT_AS const u64 &gid_max, \
uint3 hc_gid [[ thread_position_in_grid ]]
#define KERN_ATTR_GPU_MEMSET \
GLOBAL_AS uint4 *buf, \
CONSTANT_AS const u32 &value, \
CONSTANT_AS const u64 &gid_max, \
uint3 hc_gid [[ thread_position_in_grid ]]
#define KERN_ATTR_GPU_BZERO \
GLOBAL_AS uint4 *buf, \
CONSTANT_AS const u64 &gid_max, \
uint3 hc_gid [[ thread_position_in_grid ]]
#define KERN_ATTR_GPU_ATINIT \
GLOBAL_AS pw_t *buf, \
CONSTANT_AS const u64 &gid_max, \
uint3 hc_gid [[ thread_position_in_grid ]]
#define KERN_ATTR_GPU_UTF8_TO_UTF16 \
GLOBAL_AS pw_t *pws_buf, \
CONSTANT_AS const u64 &gid_max, \
uint3 hc_gid [[ thread_position_in_grid ]]
#else // CUDA, HIP, OpenCL
#define KERN_ATTR_GPU_DECOMPRESS \
GLOBAL_AS pw_idx_t *pws_idx, \
GLOBAL_AS u32 *pws_comp, \
GLOBAL_AS pw_t *pws_buf, \
const u64 gid_max
#define KERN_ATTR_GPU_MEMSET \
GLOBAL_AS uint4 *buf, \
const u32 value, \
const u64 gid_max
#define KERN_ATTR_GPU_BZERO \
GLOBAL_AS uint4 *buf, \
const u64 gid_max
#define KERN_ATTR_GPU_ATINIT \
GLOBAL_AS pw_t *buf, \
const u64 gid_max
#define KERN_ATTR_GPU_UTF8_TO_UTF16 \
GLOBAL_AS pw_t *pws_buf, \
const u64 gid_max
#endif // IS_METAL
DECLSPEC void gpu_decompress_entry (GLOBAL_AS pw_idx_t *pws_idx, GLOBAL_AS u32 *pws_comp, PRIVATE_AS pw_t *buf, const u64 gid);
#endif // INC_SHARED_H