Skip to content

[OPENCL] Implement PFAC kernel: one thread per text offset #10

Description

@hubertwojcik

Goal

Implement the core PFAC OpenCL kernel where each work-item starts from a unique text offset and independently traverses the automaton until a dead state or match is found.

Tasks

  • Write kernels/pfac.cl: each work-item i starts at text[i] and walks the automaton
  • Write match output to a result buffer: matches[i] = pattern_id or -1
  • Choose global work size = text length; tune local work size for M4 Pro
  • Collect and compact match results on the host side
  • Verify correctness: results match sequential baseline on all test inputs

Acceptance Criteria

  • PFAC kernel produces correct match output on all test inputs
  • Kernel compiles without warnings under Apple's OpenCL compiler
  • End-to-end GPU execution (transfer + kernel + readback) measured and logged

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    algorithmCore algorithm implementation: trie, failure links, automatonopenclOpenCL GPU implementation (PFAC)

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions