openwall / openwall/john

Use unified helper functions for creating and destroying OpenCL buffers/mappings - and/or for re-introducing CUDA

Open
#4,363 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement maintenance/cleanup
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Many formats have variants of this:

#define CLCREATEBUFFER(_flags, _size)         \
    clCreateBuffer(context[gpu_id], _flags, _size, NULL, &cl_error); \
    HANDLE_CLERROR(cl_error, "Error allocating GPU memory");

#define CLKERNELARG(kernel, id, arg)      \
    HANDLE_CLERROR(clSetKernelArg(kernel, id, sizeof(arg), &arg), \
                   "Error setting kernel argument");
(...)

We should have such macros in opencl_common.h and use them everywhere. They can have memory-leak detection like my debug macros for #4354 (could in fact be in place all the time, not just for debugging).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading opencl_common.h and comparing the format-specific buffer and mapping macros described in the issue. Review the debug macros from #4354 and determine the intended common interface and leak-detection behavior. Done means the relevant OpenCL paths use unified helpers, with any CUDA reintroduction scope explicitly settled.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.