mirror of
https://github.com/hashcat/hashcat.git
synced 2025-06-03 14:49:00 +00:00
Modify OpenCL clEnqueueFillBuffer() workaround
This commit is contained in:
parent
dbe2bad098
commit
fdbfae9a28
@ -5059,11 +5059,9 @@ int run_opencl_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *dev
|
|||||||
/* workaround if missing clEnqueueFillBuffer() */
|
/* workaround if missing clEnqueueFillBuffer() */
|
||||||
if (ocl->clEnqueueFillBuffer == NULL)
|
if (ocl->clEnqueueFillBuffer == NULL)
|
||||||
{
|
{
|
||||||
const u64 len = offset + size;
|
char *tmp = hcmalloc (size * sizeof (u8));
|
||||||
|
|
||||||
char *tmp = hcmalloc (len * sizeof (u8));
|
memset (tmp, value, size);
|
||||||
|
|
||||||
memset (tmp, value, len);
|
|
||||||
|
|
||||||
/* blocking */
|
/* blocking */
|
||||||
rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, CL_TRUE, offset, size, tmp, 0, NULL, NULL);
|
rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, buf, CL_TRUE, offset, size, tmp, 0, NULL, NULL);
|
||||||
@ -5088,11 +5086,9 @@ int run_opencl_kernel_memset32 (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *d
|
|||||||
/* workaround if missing clEnqueueFillBuffer() */
|
/* workaround if missing clEnqueueFillBuffer() */
|
||||||
if (ocl->clEnqueueFillBuffer == NULL)
|
if (ocl->clEnqueueFillBuffer == NULL)
|
||||||
{
|
{
|
||||||
const u64 len = offset + size;
|
u32 *tmp = (u32 *) hcmalloc (size * sizeof (u32));
|
||||||
|
|
||||||
u32 *tmp = (u32 *) hcmalloc (len * sizeof (u32));
|
for (u64 i = 0; i < size; i++)
|
||||||
|
|
||||||
for (u64 i = 0; i < len; i++)
|
|
||||||
{
|
{
|
||||||
tmp[i] = value;
|
tmp[i] = value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user