CUDA-Q Adapter v0.1
|
Ready to use the MQSS CUDA-Q Adapter? This guide will help you get started.
Since the MQSS CUDA-Q Adapter is a plugin of the NVIDIA CUDA-Quantum (CUDA-Q) programming interface, your system must contain an installation of CUDA-Q as a main prerequisite.
We recommend to follow the instructions of installation described in the following link: CUDA-Q Documentation
Clone the MQSS CUDA-Q Adapter:
Change into the project directory:
Run the following command to update the sub-modules of the project:
Run the following script to configure this project and set up the MQSS CUDA-Q Adapter:
Dev Containers (short for Development Containers) are an environment configuration that allows developers to create a consistent, isolated environment for development, testing, and deployment. They are typically used in conjunction with Visual Studio Code (VS Code) and Docker to ensure that the development environment is the same across all team members, regardless of their host machine or operating system.
The previous steps creates an isolated environment where you can tests this project. The project is located:
Building the project requires a C++ compiler supporting C11 and a minimum CMake version of 3.19. The example devices and the tests require a C++ compiler supporting C++17 and C++20 dialects.
The MQSS CUDA-Q Adapter uses CMake as its build system. However, we provide an script build.sh
that first builds the required Cuda-Q libraries. Then, the script builds the MQSS CUDA-Q Adapter project. You can configure and build the project as follows:
In the following, we describe each of the arguments accepted by build.sh
.
--jobs
(optional) The number of jobs utilized to configure and compile this project. If not specified, a single job is used to compile the project.--debug
(optional) Used to show debug information. If you want to build the project without debug information, do not include it.--mlir-dir
Path of your MLIR installation. E.g., /opt/llvm/lib/cmake/mlir/
--clang-dir
Path of your Clang installation.--llvm-dir
Path of your LLVM installation.--build-tests
(optional) Include it if you want to build the tests of this project.--build-docs
(optional) Include it if you want to build this documentation.To install the MQSS CUDA-Q Adapter into your local CUDA-Q installation, you have to run the following script:
--cudaq-install-dir
Path of your local CUDA-Q installation. E.g., /usr/local/cudaq
.After the installation you can verify if the installation was successful, by running the following script:
You can see listed the targets mqssHPC
and mqssMQP
corresponding to the HPC and MQP access to the MQSS, respectively.
We use the GoogleTest framework for unit testing the MQP and HPC access to the MQSS using the MQSS CUDA-Q Adapter. All tests are contained in the test
directory. You can configure and build the project using CMake as follows:
The executables used to run the tests can be found at build/tests/
.
For the information to be displayed correctly in the documentation, it is essential that the comments follow the format required by Doxygen. Below you find some tags, that are commonly used within the documentation of a function:
@brief
For a brief, one-line description of the function. Should always be provided.@details
For a longer, detailed description of the function.@param
To explain the usage of a parameter. Should be provided for each parameter.@return
To explain the return value. Should be provided if the function returns a value.The documentation is generated using Doxygen, which is seamlessly integrated into the CMake build system.
The documentation can be built configuring the CMake as follows:
The generated webpage can be inspected by opening the file in docs/html/index.html
in the CMake build directory.
The generated webpage also contains four static sites, namely the main page, the support page, the FAQ page, and this development guide. The respective markdown files that serve as the source for those sites are contained in docs/
where index.md
contains the content of the main page.
In order to include source files to be listed among the menu item API Reference/Files
, these files must be marked as documented. This is accomplished by adding a comment like the following to the top of the file. Right now, this is done for all files in the include directory.