@@ -102,11 +102,11 @@ cdef void* __custatevecAbs2SumArrayBatched = NULL
102102cdef void * __custatevecCollapseByBitStringBatchedGetWorkspaceSize = NULL
103103cdef void * __custatevecCollapseByBitStringBatched = NULL
104104cdef void * __custatevecMeasureBatched = NULL
105- cdef void * __custatevecComputeExpectationBatchedGetWorkspaceSize = NULL
106- cdef void * __custatevecComputeExpectationBatched = NULL
107105cdef void * __custatevecSubSVMigratorCreate = NULL
108106cdef void * __custatevecSubSVMigratorDestroy = NULL
109107cdef void * __custatevecSubSVMigratorMigrate = NULL
108+ cdef void * __custatevecComputeExpectationBatchedGetWorkspaceSize = NULL
109+ cdef void * __custatevecComputeExpectationBatched = NULL
110110
111111
112112cdef void * load_library() except * nogil:
@@ -602,20 +602,6 @@ cdef int _check_or_init_custatevec() except -1 nogil:
602602 handle = load_library()
603603 __custatevecMeasureBatched = dlsym(handle, ' custatevecMeasureBatched' )
604604
605- global __custatevecComputeExpectationBatchedGetWorkspaceSize
606- __custatevecComputeExpectationBatchedGetWorkspaceSize = dlsym(RTLD_DEFAULT, ' custatevecComputeExpectationBatchedGetWorkspaceSize' )
607- if __custatevecComputeExpectationBatchedGetWorkspaceSize == NULL :
608- if handle == NULL :
609- handle = load_library()
610- __custatevecComputeExpectationBatchedGetWorkspaceSize = dlsym(handle, ' custatevecComputeExpectationBatchedGetWorkspaceSize' )
611-
612- global __custatevecComputeExpectationBatched
613- __custatevecComputeExpectationBatched = dlsym(RTLD_DEFAULT, ' custatevecComputeExpectationBatched' )
614- if __custatevecComputeExpectationBatched == NULL :
615- if handle == NULL :
616- handle = load_library()
617- __custatevecComputeExpectationBatched = dlsym(handle, ' custatevecComputeExpectationBatched' )
618-
619605 global __custatevecSubSVMigratorCreate
620606 __custatevecSubSVMigratorCreate = dlsym(RTLD_DEFAULT, ' custatevecSubSVMigratorCreate' )
621607 if __custatevecSubSVMigratorCreate == NULL :
@@ -636,6 +622,20 @@ cdef int _check_or_init_custatevec() except -1 nogil:
636622 if handle == NULL :
637623 handle = load_library()
638624 __custatevecSubSVMigratorMigrate = dlsym(handle, ' custatevecSubSVMigratorMigrate' )
625+
626+ global __custatevecComputeExpectationBatchedGetWorkspaceSize
627+ __custatevecComputeExpectationBatchedGetWorkspaceSize = dlsym(RTLD_DEFAULT, ' custatevecComputeExpectationBatchedGetWorkspaceSize' )
628+ if __custatevecComputeExpectationBatchedGetWorkspaceSize == NULL :
629+ if handle == NULL :
630+ handle = load_library()
631+ __custatevecComputeExpectationBatchedGetWorkspaceSize = dlsym(handle, ' custatevecComputeExpectationBatchedGetWorkspaceSize' )
632+
633+ global __custatevecComputeExpectationBatched
634+ __custatevecComputeExpectationBatched = dlsym(RTLD_DEFAULT, ' custatevecComputeExpectationBatched' )
635+ if __custatevecComputeExpectationBatched == NULL :
636+ if handle == NULL :
637+ handle = load_library()
638+ __custatevecComputeExpectationBatched = dlsym(handle, ' custatevecComputeExpectationBatched' )
639639
640640 __py_custatevec_init = True
641641 return 0
@@ -849,12 +849,6 @@ cpdef dict _inspect_function_pointers():
849849 global __custatevecMeasureBatched
850850 data[" __custatevecMeasureBatched" ] = < intptr_t> __custatevecMeasureBatched
851851
852- global __custatevecComputeExpectationBatchedGetWorkspaceSize
853- data[" __custatevecComputeExpectationBatchedGetWorkspaceSize" ] = < intptr_t> __custatevecComputeExpectationBatchedGetWorkspaceSize
854-
855- global __custatevecComputeExpectationBatched
856- data[" __custatevecComputeExpectationBatched" ] = < intptr_t> __custatevecComputeExpectationBatched
857-
858852 global __custatevecSubSVMigratorCreate
859853 data[" __custatevecSubSVMigratorCreate" ] = < intptr_t> __custatevecSubSVMigratorCreate
860854
@@ -863,6 +857,12 @@ cpdef dict _inspect_function_pointers():
863857
864858 global __custatevecSubSVMigratorMigrate
865859 data[" __custatevecSubSVMigratorMigrate" ] = < intptr_t> __custatevecSubSVMigratorMigrate
860+
861+ global __custatevecComputeExpectationBatchedGetWorkspaceSize
862+ data[" __custatevecComputeExpectationBatchedGetWorkspaceSize" ] = < intptr_t> __custatevecComputeExpectationBatchedGetWorkspaceSize
863+
864+ global __custatevecComputeExpectationBatched
865+ data[" __custatevecComputeExpectationBatched" ] = < intptr_t> __custatevecComputeExpectationBatched
866866
867867 return data
868868
@@ -1551,26 +1551,6 @@ cdef custatevecStatus_t _custatevecMeasureBatched(custatevecHandle_t handle, voi
15511551 handle, batchedSv, svDataType, nIndexBits, nSVs, svStride, bitStrings, bitOrdering, bitStringLen, randnums, collapse)
15521552
15531553
1554- cdef custatevecStatus_t _custatevecComputeExpectationBatchedGetWorkspaceSize(custatevecHandle_t handle, cudaDataType_t svDataType, const uint32_t nIndexBits, const uint32_t nSVs, const custatevecIndex_t svStride, const void * matrices, cudaDataType_t matrixDataType, custatevecMatrixLayout_t layout, const uint32_t nMatrices, const uint32_t nBasisBits, custatevecComputeType_t computeType, size_t* extraWorkspaceSizeInBytes) except * nogil:
1555- global __custatevecComputeExpectationBatchedGetWorkspaceSize
1556- _check_or_init_custatevec()
1557- if __custatevecComputeExpectationBatchedGetWorkspaceSize == NULL :
1558- with gil:
1559- raise FunctionNotFoundError(" function custatevecComputeExpectationBatchedGetWorkspaceSize is not found" )
1560- return (< custatevecStatus_t (* )(custatevecHandle_t, cudaDataType_t, const uint32_t, const uint32_t, const custatevecIndex_t, const void * , cudaDataType_t, custatevecMatrixLayout_t, const uint32_t, const uint32_t, custatevecComputeType_t, size_t* ) nogil> __custatevecComputeExpectationBatchedGetWorkspaceSize)(
1561- handle, svDataType, nIndexBits, nSVs, svStride, matrices, matrixDataType, layout, nMatrices, nBasisBits, computeType, extraWorkspaceSizeInBytes)
1562-
1563-
1564- cdef custatevecStatus_t _custatevecComputeExpectationBatched(custatevecHandle_t handle, const void * batchedSv, cudaDataType_t svDataType, const uint32_t nIndexBits, const uint32_t nSVs, custatevecIndex_t svStride, double2* expectationValues, const void * matrices, cudaDataType_t matrixDataType, custatevecMatrixLayout_t layout, const uint32_t nMatrices, const int32_t* basisBits, const uint32_t nBasisBits, custatevecComputeType_t computeType, void * extraWorkspace, size_t extraWorkspaceSizeInBytes) except * nogil:
1565- global __custatevecComputeExpectationBatched
1566- _check_or_init_custatevec()
1567- if __custatevecComputeExpectationBatched == NULL :
1568- with gil:
1569- raise FunctionNotFoundError(" function custatevecComputeExpectationBatched is not found" )
1570- return (< custatevecStatus_t (* )(custatevecHandle_t, const void * , cudaDataType_t, const uint32_t, const uint32_t, custatevecIndex_t, double2* , const void * , cudaDataType_t, custatevecMatrixLayout_t, const uint32_t, const int32_t* , const uint32_t, custatevecComputeType_t, void * , size_t) nogil> __custatevecComputeExpectationBatched)(
1571- handle, batchedSv, svDataType, nIndexBits, nSVs, svStride, expectationValues, matrices, matrixDataType, layout, nMatrices, basisBits, nBasisBits, computeType, extraWorkspace, extraWorkspaceSizeInBytes)
1572-
1573-
15741554cdef custatevecStatus_t _custatevecSubSVMigratorCreate(custatevecHandle_t handle, custatevecSubSVMigratorDescriptor_t* migrator, void * deviceSlots, cudaDataType_t svDataType, int nDeviceSlots, int nLocalIndexBits) except * nogil:
15751555 global __custatevecSubSVMigratorCreate
15761556 _check_or_init_custatevec()
@@ -1599,3 +1579,23 @@ cdef custatevecStatus_t _custatevecSubSVMigratorMigrate(custatevecHandle_t handl
15991579 raise FunctionNotFoundError(" function custatevecSubSVMigratorMigrate is not found" )
16001580 return (< custatevecStatus_t (* )(custatevecHandle_t, custatevecSubSVMigratorDescriptor_t, int , const void * , void * , custatevecIndex_t, custatevecIndex_t) nogil> __custatevecSubSVMigratorMigrate)(
16011581 handle, migrator, deviceSlotIndex, srcSubSV, dstSubSV, begin, end)
1582+
1583+
1584+ cdef custatevecStatus_t _custatevecComputeExpectationBatchedGetWorkspaceSize(custatevecHandle_t handle, cudaDataType_t svDataType, const uint32_t nIndexBits, const uint32_t nSVs, const custatevecIndex_t svStride, const void * matrices, cudaDataType_t matrixDataType, custatevecMatrixLayout_t layout, const uint32_t nMatrices, const uint32_t nBasisBits, custatevecComputeType_t computeType, size_t* extraWorkspaceSizeInBytes) except * nogil:
1585+ global __custatevecComputeExpectationBatchedGetWorkspaceSize
1586+ _check_or_init_custatevec()
1587+ if __custatevecComputeExpectationBatchedGetWorkspaceSize == NULL :
1588+ with gil:
1589+ raise FunctionNotFoundError(" function custatevecComputeExpectationBatchedGetWorkspaceSize is not found" )
1590+ return (< custatevecStatus_t (* )(custatevecHandle_t, cudaDataType_t, const uint32_t, const uint32_t, const custatevecIndex_t, const void * , cudaDataType_t, custatevecMatrixLayout_t, const uint32_t, const uint32_t, custatevecComputeType_t, size_t* ) nogil> __custatevecComputeExpectationBatchedGetWorkspaceSize)(
1591+ handle, svDataType, nIndexBits, nSVs, svStride, matrices, matrixDataType, layout, nMatrices, nBasisBits, computeType, extraWorkspaceSizeInBytes)
1592+
1593+
1594+ cdef custatevecStatus_t _custatevecComputeExpectationBatched(custatevecHandle_t handle, const void * batchedSv, cudaDataType_t svDataType, const uint32_t nIndexBits, const uint32_t nSVs, custatevecIndex_t svStride, double2* expectationValues, const void * matrices, cudaDataType_t matrixDataType, custatevecMatrixLayout_t layout, const uint32_t nMatrices, const int32_t* basisBits, const uint32_t nBasisBits, custatevecComputeType_t computeType, void * extraWorkspace, size_t extraWorkspaceSizeInBytes) except * nogil:
1595+ global __custatevecComputeExpectationBatched
1596+ _check_or_init_custatevec()
1597+ if __custatevecComputeExpectationBatched == NULL :
1598+ with gil:
1599+ raise FunctionNotFoundError(" function custatevecComputeExpectationBatched is not found" )
1600+ return (< custatevecStatus_t (* )(custatevecHandle_t, const void * , cudaDataType_t, const uint32_t, const uint32_t, custatevecIndex_t, double2* , const void * , cudaDataType_t, custatevecMatrixLayout_t, const uint32_t, const int32_t* , const uint32_t, custatevecComputeType_t, void * , size_t) nogil> __custatevecComputeExpectationBatched)(
1601+ handle, batchedSv, svDataType, nIndexBits, nSVs, svStride, expectationValues, matrices, matrixDataType, layout, nMatrices, basisBits, nBasisBits, computeType, extraWorkspace, extraWorkspaceSizeInBytes)
0 commit comments