Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macros for generating the device entry-point and declarations #400

Merged
merged 9 commits into from
Dec 11, 2023

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Dec 8, 2023

This PR adds a C++ template macro to facilitate the generation of a device entry-point. For every implementation of QuantumDevice, there are a repeated list of methods declarations in the header file of the class. These declarations can be templated away to reduce the redundant code to write a new backend device. This PR addresses this issue with introducing a couple of macros to generate these declarations. It also updates the signature of extern "C" factory methods to stick to the C data-types.

@maliasadi maliasadi added the runtime Pull requests that update the runtime label Dec 8, 2023
@maliasadi maliasadi requested a review from dime10 December 8, 2023 19:21
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7bfe53e) 99.49% compared to head (290d881) 99.49%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #400   +/-   ##
=======================================
  Coverage   99.49%   99.49%           
=======================================
  Files          42       42           
  Lines        7150     7150           
  Branches      483      483           
=======================================
  Hits         7114     7114           
  Misses         20       20           
  Partials       16       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

runtime/include/QuantumDevice.hpp Outdated Show resolved Hide resolved
doc/dev/custom_devices.rst Outdated Show resolved Hide resolved
doc/changelog.md Outdated Show resolved Hide resolved
@maliasadi maliasadi changed the title Add a templated macro for generating the device entry-points Add macros for generating the device entry-point and declarations Dec 11, 2023
doc/changelog.md Outdated Show resolved Hide resolved
@maliasadi maliasadi merged commit 980f584 into main Dec 11, 2023
19 checks passed
@maliasadi maliasadi deleted the maa/templated-dev-factory branch December 11, 2023 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime Pull requests that update the runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants