Skip to content

Fix for the latest cuStateVec APIs#1489

Merged
hhorii merged 4 commits into
Qiskit:mainfrom
doichanj:cuStateVec040
Mar 28, 2022
Merged

Fix for the latest cuStateVec APIs#1489
hhorii merged 4 commits into
Qiskit:mainfrom
doichanj:cuStateVec040

Conversation

@doichanj
Copy link
Copy Markdown
Collaborator

@doichanj doichanj commented Mar 23, 2022

Summary

This is the fix to support the latest cuQuantum (ver. 0.40).

Details and comments

Compilation failed with cuStateVec support because some cuStateVec APIs' name and parameters are changed from the previous version. This PR follows the latest cuStateVec.

Also cuQuantum 0.40 newly supports memory pool mechanism to allocate work space inside cuStateVec APIs.
Qiskit Aer now use memory pool instead of allocating static work buffer if the version of CUDA installed on the system supports it.

@doichanj doichanj requested a review from hhorii March 23, 2022 09:17

#include "custatevec.h"

#define SUPPORTS_MEMORY_POOL ( __CUDACC_VER_MAJOR__ > 11 || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ >= 2))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we always use memory pool if it provides performance in any simulation? The latest cuQuantum changed its API (such as custatevecSamplerCreate) and the current cuStateVec_chunk_container.hpp does not support previous API (custatevecSampler_create). I guess, if the current code is based on the latest API, memory pool is always available.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed codes for older version of CUDA and now 11.2 or newer version is required to use cuStateVec support (added in CONTRIBUTING.md)

I think sampling does not support memory pool (https://docs.nvidia.com/cuda/cuquantum/custatevec/api/functions.html#sampling)
so work buffer should be allocated if needed.

@hhorii hhorii merged commit 0ffe6f2 into Qiskit:main Mar 28, 2022
@hhorii hhorii mentioned this pull request Mar 29, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants