Skip to content

[Refactor] Reduce duplicated CUDA dispatch logic in qdp-python engine bindings #1281

Description

@viiccwen

What

Refactor qdp-python engine bindings to reduce duplicated CUDA dispatch and error-mapping logic.

Recent batch float32 CUDA angle work intentionally kept scope tight and did not restructure the surrounding dispatch code. As a result, some CUDA-specific dispatch branches still repeat similar control flow and error wrapping.

Why

This duplication is not a blocking bug, but it increases maintenance cost and makes future binding changes easier to implement inconsistently.

Reducing repeated dispatch structure should make it easier to maintain consistency across:

  • 1D vs 2D CUDA paths
  • float32 vs float64 CUDA paths
  • encoding-specific GPU fast paths

How

  • inspect the CUDA dispatch paths in qdp-python engine bindings
  • identify low-risk opportunities to consolidate repeated branching and map_err(...) patterns
  • preserve current external behavior
  • keep this follow-up narrowly scoped to internal cleanup in qdp-python, without mixing in new feature work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions