diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index ad62ab36cd3..a4213960404 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0, generator version 49a8141. Do not modify it directly. +# This code was automatically generated with version 12.9.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly. {{if 'Windows' == platform.system()}} import os cimport cuda.bindings._lib.windll as windll @@ -501,7 +501,7 @@ cdef int _cuPythonInit() except -1 nogil: cdef char libPath[260] with gil, __symbol_lock: - usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0) + usePTDS = bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))) # Load library libPath[0] = 0 diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in index 0bf332174cd..6ef5e9b1b9b 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0, generator version 49a8141. Do not modify it directly. +# This code was automatically generated with version 12.9.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly. include "../cyruntime_functions.pxi" import os @@ -15,7 +15,7 @@ cdef int _cudaPythonInit() except -1 nogil: global __usePTDS with gil: - __usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=False) + __usePTDS = bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))) __cudaPythonInit = True return __usePTDS diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index 57c1a1ae5c9..e7a6a9ae279 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0, generator version 0.3.1.dev1588+g61faef43a. Do not modify it directly. +# This code was automatically generated with version 12.9.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly. from typing import Any, Optional import cython import ctypes @@ -38711,7 +38711,9 @@ def cuStreamGetCaptureInfo(hStream): with nogil: err = cydriver.cuStreamGetCaptureInfo(cyhStream, &captureStatus_out, id_out._pvt_ptr, graph_out._pvt_ptr, &cydependencies_out, &numDependencies_out) if CUresult(err) == CUresult(0): - pydependencies_out = [CUgraphNode(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] + pydependencies_out = [CUgraphNode() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None, None, None, None) return (_CUresult_SUCCESS, CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, numDependencies_out) @@ -38809,9 +38811,13 @@ def cuStreamGetCaptureInfo_v3(hStream): with nogil: err = cydriver.cuStreamGetCaptureInfo_v3(cyhStream, &captureStatus_out, id_out._pvt_ptr, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) if CUresult(err) == CUresult(0): - pydependencies_out = [CUgraphNode(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] + pydependencies_out = [CUgraphNode() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] if CUresult(err) == CUresult(0): - pyedgeData_out = [CUgraphEdgeData(_ptr=&cyedgeData_out[idx]) for idx in range(numDependencies_out)] + pyedgeData_out = [CUgraphEdgeData() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pyedgeData_out[idx])._pvt_ptr[0] = cyedgeData_out[idx] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None, None, None, None, None) return (_CUresult_SUCCESS, CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) @@ -45204,7 +45210,9 @@ def cuGraphGetNodes(hGraph, size_t numNodes = 0): with nogil: err = cydriver.cuGraphGetNodes(cyhGraph, cynodes, &numNodes) if CUresult(err) == CUresult(0): - pynodes = [CUgraphNode(init_value=cynodes[idx]) for idx in range(_graph_length)] + pynodes = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pynodes[idx])._pvt_ptr[0] = cynodes[idx] if cynodes is not NULL: free(cynodes) if err != cydriver.CUDA_SUCCESS: @@ -45263,7 +45271,9 @@ def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): with nogil: err = cydriver.cuGraphGetRootNodes(cyhGraph, cyrootNodes, &numRootNodes) if CUresult(err) == CUresult(0): - pyrootNodes = [CUgraphNode(init_value=cyrootNodes[idx]) for idx in range(_graph_length)] + pyrootNodes = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyrootNodes[idx])._pvt_ptr[0] = cyrootNodes[idx] if cyrootNodes is not NULL: free(cyrootNodes) if err != cydriver.CUDA_SUCCESS: @@ -45332,11 +45342,15 @@ def cuGraphGetEdges(hGraph, size_t numEdges = 0): with nogil: err = cydriver.cuGraphGetEdges(cyhGraph, cyfrom_, cyto, &numEdges) if CUresult(err) == CUresult(0): - pyfrom_ = [CUgraphNode(init_value=cyfrom_[idx]) for idx in range(_graph_length)] + pyfrom_ = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyfrom_[idx])._pvt_ptr[0] = cyfrom_[idx] if cyfrom_ is not NULL: free(cyfrom_) if CUresult(err) == CUresult(0): - pyto = [CUgraphNode(init_value=cyto[idx]) for idx in range(_graph_length)] + pyto = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyto[idx])._pvt_ptr[0] = cyto[idx] if cyto is not NULL: free(cyto) if err != cydriver.CUDA_SUCCESS: @@ -45418,15 +45432,21 @@ def cuGraphGetEdges_v2(hGraph, size_t numEdges = 0): with nogil: err = cydriver.cuGraphGetEdges_v2(cyhGraph, cyfrom_, cyto, cyedgeData, &numEdges) if CUresult(err) == CUresult(0): - pyfrom_ = [CUgraphNode(init_value=cyfrom_[idx]) for idx in range(_graph_length)] + pyfrom_ = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyfrom_[idx])._pvt_ptr[0] = cyfrom_[idx] if cyfrom_ is not NULL: free(cyfrom_) if CUresult(err) == CUresult(0): - pyto = [CUgraphNode(init_value=cyto[idx]) for idx in range(_graph_length)] + pyto = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyto[idx])._pvt_ptr[0] = cyto[idx] if cyto is not NULL: free(cyto) if CUresult(err) == CUresult(0): - pyedgeData = [CUgraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [CUgraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: @@ -45486,7 +45506,9 @@ def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): with nogil: err = cydriver.cuGraphNodeGetDependencies(cyhNode, cydependencies, &numDependencies) if CUresult(err) == CUresult(0): - pydependencies = [CUgraphNode(init_value=cydependencies[idx]) for idx in range(_graph_length)] + pydependencies = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pydependencies[idx])._pvt_ptr[0] = cydependencies[idx] if cydependencies is not NULL: free(cydependencies) if err != cydriver.CUDA_SUCCESS: @@ -45559,11 +45581,15 @@ def cuGraphNodeGetDependencies_v2(hNode, size_t numDependencies = 0): with nogil: err = cydriver.cuGraphNodeGetDependencies_v2(cyhNode, cydependencies, cyedgeData, &numDependencies) if CUresult(err) == CUresult(0): - pydependencies = [CUgraphNode(init_value=cydependencies[idx]) for idx in range(_graph_length)] + pydependencies = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pydependencies[idx])._pvt_ptr[0] = cydependencies[idx] if cydependencies is not NULL: free(cydependencies) if CUresult(err) == CUresult(0): - pyedgeData = [CUgraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [CUgraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: @@ -45623,7 +45649,9 @@ def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): with nogil: err = cydriver.cuGraphNodeGetDependentNodes(cyhNode, cydependentNodes, &numDependentNodes) if CUresult(err) == CUresult(0): - pydependentNodes = [CUgraphNode(init_value=cydependentNodes[idx]) for idx in range(_graph_length)] + pydependentNodes = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pydependentNodes[idx])._pvt_ptr[0] = cydependentNodes[idx] if cydependentNodes is not NULL: free(cydependentNodes) if err != cydriver.CUDA_SUCCESS: @@ -45696,11 +45724,15 @@ def cuGraphNodeGetDependentNodes_v2(hNode, size_t numDependentNodes = 0): with nogil: err = cydriver.cuGraphNodeGetDependentNodes_v2(cyhNode, cydependentNodes, cyedgeData, &numDependentNodes) if CUresult(err) == CUresult(0): - pydependentNodes = [CUgraphNode(init_value=cydependentNodes[idx]) for idx in range(_graph_length)] + pydependentNodes = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pydependentNodes[idx])._pvt_ptr[0] = cydependentNodes[idx] if cydependentNodes is not NULL: free(cydependentNodes) if CUresult(err) == CUresult(0): - pyedgeData = [CUgraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [CUgraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index 570bbffc241..54c82754286 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -# This code was automatically generated with version 12.9.0, generator version 49a8141. Do not modify it directly. +# This code was automatically generated with version 12.9.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly. from typing import Any, Optional import cython import ctypes @@ -19488,7 +19488,7 @@ def cudaDeviceGetTexture1DLinearMaxWidth(fmtDesc : Optional[cudaChannelFormatDes :py:obj:`~.cuDeviceGetTexture1DLinearMaxWidth` """ cdef size_t maxWidthInElements = 0 - cdef cyruntime.cudaChannelFormatDesc* cyfmtDesc_ptr = fmtDesc._pvt_ptr if fmtDesc is not None else NULL + cdef cyruntime.cudaChannelFormatDesc* cyfmtDesc_ptr = fmtDesc._pvt_ptr if fmtDesc is not None else NULL with nogil: err = cyruntime.cudaDeviceGetTexture1DLinearMaxWidth(&maxWidthInElements, cyfmtDesc_ptr, device) if err != cyruntime.cudaSuccess: @@ -21423,7 +21423,7 @@ def cudaChooseDevice(prop : Optional[cudaDeviceProp]): :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaInitDevice` """ cdef int device = 0 - cdef cyruntime.cudaDeviceProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL + cdef cyruntime.cudaDeviceProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL with nogil: err = cyruntime.cudaChooseDevice(&device, cyprop_ptr) if err != cyruntime.cudaSuccess: @@ -22164,7 +22164,7 @@ def cudaStreamSetAttribute(hStream, attr not None : cudaStreamAttrID, value : Op phStream = int(cudaStream_t(hStream)) cyhStream = phStream cdef cyruntime.cudaStreamAttrID cyattr = int(attr) - cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL + cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) return (_cudaError_t(err),) @@ -23001,7 +23001,9 @@ def cudaStreamGetCaptureInfo(stream): with nogil: err = cyruntime.cudaStreamGetCaptureInfo(cystream, &captureStatus_out, &id_out, graph_out._pvt_ptr, &cydependencies_out, &numDependencies_out) if cudaError_t(err) == cudaError_t(0): - pydependencies_out = [cudaGraphNode_t(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] + pydependencies_out = [cudaGraphNode_t() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] if err != cyruntime.cudaSuccess: return (_cudaError_t(err), None, None, None, None, None) return (_cudaError_t_SUCCESS, cudaStreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, numDependencies_out) @@ -23099,9 +23101,13 @@ def cudaStreamGetCaptureInfo_v3(stream): with nogil: err = cyruntime.cudaStreamGetCaptureInfo_v3(cystream, &captureStatus_out, &id_out, graph_out._pvt_ptr, &cydependencies_out, &cyedgeData_out, &numDependencies_out) if cudaError_t(err) == cudaError_t(0): - pydependencies_out = [cudaGraphNode_t(init_value=cydependencies_out[idx]) for idx in range(numDependencies_out)] + pydependencies_out = [cudaGraphNode_t() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] if cudaError_t(err) == cudaError_t(0): - pyedgeData_out = [cudaGraphEdgeData(_ptr=&cyedgeData_out[idx]) for idx in range(numDependencies_out)] + pyedgeData_out = [cudaGraphEdgeData() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pyedgeData_out[idx])._pvt_ptr[0] = cyedgeData_out[idx] if err != cyruntime.cudaSuccess: return (_cudaError_t(err), None, None, None, None, None, None) return (_cudaError_t_SUCCESS, cudaStreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) @@ -23895,7 +23901,7 @@ def cudaImportExternalMemory(memHandleDesc : Optional[cudaExternalMemoryHandleDe and Cache Control" chapter from Vulkan specification. """ cdef cudaExternalMemory_t extMem_out = cudaExternalMemory_t() - cdef cyruntime.cudaExternalMemoryHandleDesc* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc is not None else NULL + cdef cyruntime.cudaExternalMemoryHandleDesc* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc is not None else NULL with nogil: err = cyruntime.cudaImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) if err != cyruntime.cudaSuccess: @@ -23963,7 +23969,7 @@ def cudaExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[cudaExternal pextMem = int(cudaExternalMemory_t(extMem)) cyextMem = pextMem cdef void_ptr devPtr = 0 - cdef cyruntime.cudaExternalMemoryBufferDesc* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc is not None else NULL + cdef cyruntime.cudaExternalMemoryBufferDesc* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc is not None else NULL with nogil: err = cyruntime.cudaExternalMemoryGetMappedBuffer(&devPtr, cyextMem, cybufferDesc_ptr) if err != cyruntime.cudaSuccess: @@ -24035,7 +24041,7 @@ def cudaExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[cuda pextMem = int(cudaExternalMemory_t(extMem)) cyextMem = pextMem cdef cudaMipmappedArray_t mipmap = cudaMipmappedArray_t() - cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc is not None else NULL + cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc is not None else NULL with nogil: err = cyruntime.cudaExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) if err != cyruntime.cudaSuccess: @@ -24222,7 +24228,7 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` """ cdef cudaExternalSemaphore_t extSem_out = cudaExternalSemaphore_t() - cdef cyruntime.cudaExternalSemaphoreHandleDesc* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc is not None else NULL + cdef cyruntime.cudaExternalSemaphoreHandleDesc* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc is not None else NULL with nogil: err = cyruntime.cudaImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) if err != cyruntime.cudaSuccess: @@ -25400,7 +25406,7 @@ def cudaMallocArray(desc : Optional[cudaChannelFormatDesc], size_t width, size_t :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuArrayCreate` """ cdef cudaArray_t array = cudaArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMallocArray(array._pvt_ptr, cydesc_ptr, width, height, flags) if err != cyruntime.cudaSuccess: @@ -26065,7 +26071,7 @@ def cudaMalloc3DArray(desc : Optional[cudaChannelFormatDesc], extent not None : :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.cuArray3DCreate` """ cdef cudaArray_t array = cudaArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMalloc3DArray(array._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], flags) if err != cyruntime.cudaSuccess: @@ -26191,7 +26197,7 @@ def cudaMallocMipmappedArray(desc : Optional[cudaChannelFormatDesc], extent not :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.cuMipmappedArrayCreate` """ cdef cudaMipmappedArray_t mipmappedArray = cudaMipmappedArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMallocMipmappedArray(mipmappedArray._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], numLevels, flags) if err != cyruntime.cudaSuccess: @@ -26326,7 +26332,7 @@ def cudaMemcpy3D(p : Optional[cudaMemcpy3DParms]): -------- :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemcpy3DAsync`, :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.make_cudaPos`, :py:obj:`~.cuMemcpy3D` """ - cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL + cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3D(cyp_ptr) return (_cudaError_t(err),) @@ -26363,7 +26369,7 @@ def cudaMemcpy3DPeer(p : Optional[cudaMemcpy3DPeerParms]): -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpy3DPeer` """ - cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL + cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeer(cyp_ptr) return (_cudaError_t(err),) @@ -26468,7 +26474,7 @@ def cudaMemcpy3DAsync(p : Optional[cudaMemcpy3DParms], stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL + cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DAsync(cyp_ptr, cystream) return (_cudaError_t(err),) @@ -26508,7 +26514,7 @@ def cudaMemcpy3DPeerAsync(p : Optional[cudaMemcpy3DPeerParms], stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL + cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeerAsync(cyp_ptr, cystream) return (_cudaError_t(err),) @@ -29824,7 +29830,7 @@ def cudaMemPoolGetAccess(memPool, location : Optional[cudaMemLocation]): pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef cyruntime.cudaMemAccessFlags flags - cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL with nogil: err = cyruntime.cudaMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) if err != cyruntime.cudaSuccess: @@ -29900,7 +29906,7 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): Specifying cudaMemHandleTypeNone creates a memory pool that will not support IPC. """ cdef cudaMemPool_t memPool = cudaMemPool_t() - cdef cyruntime.cudaMemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps is not None else NULL + cdef cyruntime.cudaMemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps is not None else NULL with nogil: err = cyruntime.cudaMemPoolCreate(memPool._pvt_ptr, cypoolProps_ptr) if err != cyruntime.cudaSuccess: @@ -30198,7 +30204,7 @@ def cudaMemPoolImportPointer(memPool, exportData : Optional[cudaMemPoolPtrExport pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef void_ptr ptr = 0 - cdef cyruntime.cudaMemPoolPtrExportData* cyexportData_ptr = exportData._pvt_ptr if exportData is not None else NULL + cdef cyruntime.cudaMemPoolPtrExportData* cyexportData_ptr = exportData._pvt_ptr if exportData is not None else NULL with nogil: err = cyruntime.cudaMemPoolImportPointer(&ptr, cymemPool, cyexportData_ptr) if err != cyruntime.cudaSuccess: @@ -31090,9 +31096,9 @@ def cudaCreateTextureObject(pResDesc : Optional[cudaResourceDesc], pTexDesc : Op :py:obj:`~.cudaDestroyTextureObject`, :py:obj:`~.cuTexObjectCreate` """ cdef cudaTextureObject_t pTexObject = cudaTextureObject_t() - cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL - cdef cyruntime.cudaTextureDesc* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc is not None else NULL - cdef cyruntime.cudaResourceViewDesc* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc is not None else NULL + cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL + cdef cyruntime.cudaTextureDesc* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc is not None else NULL + cdef cyruntime.cudaResourceViewDesc* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc is not None else NULL with nogil: err = cyruntime.cudaCreateTextureObject(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) if err != cyruntime.cudaSuccess: @@ -31293,7 +31299,7 @@ def cudaCreateSurfaceObject(pResDesc : Optional[cudaResourceDesc]): :py:obj:`~.cudaDestroySurfaceObject`, :py:obj:`~.cuSurfObjectCreate` """ cdef cudaSurfaceObject_t pSurfObject = cudaSurfaceObject_t() - cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL + cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL with nogil: err = cyruntime.cudaCreateSurfaceObject(pSurfObject._pvt_ptr, cypResDesc_ptr) if err != cyruntime.cudaSuccess: @@ -31587,7 +31593,7 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddKernelNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypNodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -31678,7 +31684,7 @@ def cudaGraphKernelNodeSetParams(node, pNodeParams : Optional[cudaKernelNodePara else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetParams(cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -31811,7 +31817,7 @@ def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode cdef cyruntime.cudaKernelNodeAttrID cyattr = int(attr) - cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL + cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) return (_cudaError_t(err),) @@ -31883,7 +31889,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemcpy3DParms* cypCopyParams_ptr = pCopyParams._pvt_ptr if pCopyParams is not None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypCopyParams_ptr = pCopyParams._pvt_ptr if pCopyParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemcpyNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypCopyParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -32062,7 +32068,7 @@ def cudaGraphMemcpyNodeSetParams(node, pNodeParams : Optional[cudaMemcpy3DParms] else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemcpyNodeSetParams(cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -32192,7 +32198,7 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemsetParams* cypMemsetParams_ptr = pMemsetParams._pvt_ptr if pMemsetParams is not None else NULL + cdef cyruntime.cudaMemsetParams* cypMemsetParams_ptr = pMemsetParams._pvt_ptr if pMemsetParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemsetNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypMemsetParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -32274,7 +32280,7 @@ def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]) else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemsetNodeSetParams(cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -32341,7 +32347,7 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddHostNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypNodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -32423,7 +32429,7 @@ def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]) else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphHostNodeSetParams(cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -33021,7 +33027,7 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[tup elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddExternalSemaphoresSignalNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -33110,7 +33116,7 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ else: phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresSignalNodeSetParams(cyhNode, cynodeParams_ptr) return (_cudaError_t(err),) @@ -33178,7 +33184,7 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[tuple elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddExternalSemaphoresWaitNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -33267,7 +33273,7 @@ def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cu else: phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresWaitNodeSetParams(cyhNode, cynodeParams_ptr) return (_cudaError_t(err),) @@ -33374,7 +33380,7 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[tuple[cudaGraphNode elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemAllocNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaMemAllocNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemAllocNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -33879,7 +33885,9 @@ def cudaGraphGetNodes(graph, size_t numNodes = 0): with nogil: err = cyruntime.cudaGraphGetNodes(cygraph, cynodes, &numNodes) if cudaError_t(err) == cudaError_t(0): - pynodes = [cudaGraphNode_t(init_value=cynodes[idx]) for idx in range(_graph_length)] + pynodes = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pynodes[idx])._pvt_ptr[0] = cynodes[idx] if cynodes is not NULL: free(cynodes) if err != cyruntime.cudaSuccess: @@ -33938,7 +33946,9 @@ def cudaGraphGetRootNodes(graph, size_t pNumRootNodes = 0): with nogil: err = cyruntime.cudaGraphGetRootNodes(cygraph, cypRootNodes, &pNumRootNodes) if cudaError_t(err) == cudaError_t(0): - pypRootNodes = [cudaGraphNode_t(init_value=cypRootNodes[idx]) for idx in range(_graph_length)] + pypRootNodes = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypRootNodes[idx])._pvt_ptr[0] = cypRootNodes[idx] if cypRootNodes is not NULL: free(cypRootNodes) if err != cyruntime.cudaSuccess: @@ -34007,11 +34017,15 @@ def cudaGraphGetEdges(graph, size_t numEdges = 0): with nogil: err = cyruntime.cudaGraphGetEdges(cygraph, cyfrom_, cyto, &numEdges) if cudaError_t(err) == cudaError_t(0): - pyfrom_ = [cudaGraphNode_t(init_value=cyfrom_[idx]) for idx in range(_graph_length)] + pyfrom_ = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyfrom_[idx])._pvt_ptr[0] = cyfrom_[idx] if cyfrom_ is not NULL: free(cyfrom_) if cudaError_t(err) == cudaError_t(0): - pyto = [cudaGraphNode_t(init_value=cyto[idx]) for idx in range(_graph_length)] + pyto = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyto[idx])._pvt_ptr[0] = cyto[idx] if cyto is not NULL: free(cyto) if err != cyruntime.cudaSuccess: @@ -34093,15 +34107,21 @@ def cudaGraphGetEdges_v2(graph, size_t numEdges = 0): with nogil: err = cyruntime.cudaGraphGetEdges_v2(cygraph, cyfrom_, cyto, cyedgeData, &numEdges) if cudaError_t(err) == cudaError_t(0): - pyfrom_ = [cudaGraphNode_t(init_value=cyfrom_[idx]) for idx in range(_graph_length)] + pyfrom_ = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyfrom_[idx])._pvt_ptr[0] = cyfrom_[idx] if cyfrom_ is not NULL: free(cyfrom_) if cudaError_t(err) == cudaError_t(0): - pyto = [cudaGraphNode_t(init_value=cyto[idx]) for idx in range(_graph_length)] + pyto = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyto[idx])._pvt_ptr[0] = cyto[idx] if cyto is not NULL: free(cyto) if cudaError_t(err) == cudaError_t(0): - pyedgeData = [cudaGraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [cudaGraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: @@ -34161,7 +34181,9 @@ def cudaGraphNodeGetDependencies(node, size_t pNumDependencies = 0): with nogil: err = cyruntime.cudaGraphNodeGetDependencies(cynode, cypDependencies, &pNumDependencies) if cudaError_t(err) == cudaError_t(0): - pypDependencies = [cudaGraphNode_t(init_value=cypDependencies[idx]) for idx in range(_graph_length)] + pypDependencies = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypDependencies[idx])._pvt_ptr[0] = cypDependencies[idx] if cypDependencies is not NULL: free(cypDependencies) if err != cyruntime.cudaSuccess: @@ -34234,11 +34256,15 @@ def cudaGraphNodeGetDependencies_v2(node, size_t pNumDependencies = 0): with nogil: err = cyruntime.cudaGraphNodeGetDependencies_v2(cynode, cypDependencies, cyedgeData, &pNumDependencies) if cudaError_t(err) == cudaError_t(0): - pypDependencies = [cudaGraphNode_t(init_value=cypDependencies[idx]) for idx in range(_graph_length)] + pypDependencies = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypDependencies[idx])._pvt_ptr[0] = cypDependencies[idx] if cypDependencies is not NULL: free(cypDependencies) if cudaError_t(err) == cudaError_t(0): - pyedgeData = [cudaGraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [cudaGraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: @@ -34298,7 +34324,9 @@ def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): with nogil: err = cyruntime.cudaGraphNodeGetDependentNodes(cynode, cypDependentNodes, &pNumDependentNodes) if cudaError_t(err) == cudaError_t(0): - pypDependentNodes = [cudaGraphNode_t(init_value=cypDependentNodes[idx]) for idx in range(_graph_length)] + pypDependentNodes = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypDependentNodes[idx])._pvt_ptr[0] = cypDependentNodes[idx] if cypDependentNodes is not NULL: free(cypDependentNodes) if err != cyruntime.cudaSuccess: @@ -34371,11 +34399,15 @@ def cudaGraphNodeGetDependentNodes_v2(node, size_t pNumDependentNodes = 0): with nogil: err = cyruntime.cudaGraphNodeGetDependentNodes_v2(cynode, cypDependentNodes, cyedgeData, &pNumDependentNodes) if cudaError_t(err) == cudaError_t(0): - pypDependentNodes = [cudaGraphNode_t(init_value=cypDependentNodes[idx]) for idx in range(_graph_length)] + pypDependentNodes = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypDependentNodes[idx])._pvt_ptr[0] = cypDependentNodes[idx] if cypDependentNodes is not NULL: free(cypDependentNodes) if cudaError_t(err) == cudaError_t(0): - pyedgeData = [cudaGraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [cudaGraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: @@ -35117,7 +35149,7 @@ def cudaGraphInstantiateWithParams(graph, instantiateParams : Optional[cudaGraph pgraph = int(cudaGraph_t(graph)) cygraph = pgraph cdef cudaGraphExec_t pGraphExec = cudaGraphExec_t() - cdef cyruntime.cudaGraphInstantiateParams* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams is not None else NULL + cdef cyruntime.cudaGraphInstantiateParams* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams is not None else NULL with nogil: err = cyruntime.cudaGraphInstantiateWithParams(pGraphExec._pvt_ptr, cygraph, cyinstantiateParams_ptr) if err != cyruntime.cudaSuccess: @@ -35244,7 +35276,7 @@ def cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecKernelNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -35309,7 +35341,7 @@ def cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemcpyNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -35454,7 +35486,7 @@ def cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemsetNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -35509,7 +35541,7 @@ def cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams : Optional[cuda else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecHostNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_cudaError_t(err),) @@ -35765,7 +35797,7 @@ def cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePa else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_cudaError_t(err),) @@ -35825,7 +35857,7 @@ def cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodePara else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_cudaError_t(err),) @@ -36669,7 +36701,7 @@ def cudaGraphAddNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | li elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -36765,7 +36797,7 @@ def cudaGraphAddNode_v2(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | cydependencyData = (dependencyData[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) if numDependencies > len(dependencyData): raise RuntimeError("List is too small: " + str(len(dependencyData)) + " < " + str(numDependencies)) - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddNode_v2(pGraphNode._pvt_ptr, cygraph, cypDependencies, cydependencyData, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -36815,7 +36847,7 @@ def cudaGraphNodeSetParams(node, nodeParams : Optional[cudaGraphNodeParams]): else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphNodeSetParams(cynode, cynodeParams_ptr) return (_cudaError_t(err),) @@ -36875,7 +36907,7 @@ def cudaGraphExecNodeSetParams(graphExec, node, nodeParams : Optional[cudaGraphN else: pgraphExec = int(cudaGraphExec_t(graphExec)) cygraphExec = pgraphExec - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecNodeSetParams(cygraphExec, cynode, cynodeParams_ptr) return (_cudaError_t(err),) @@ -37770,7 +37802,7 @@ def cudaKernelSetAttributeForDevice(kernel, attr not None : cudaFuncAttribute, i def cudaGetExportTable(pExportTableId : Optional[cudaUUID_t]): """""" cdef void_ptr ppExportTable = 0 - cdef cyruntime.cudaUUID_t* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not None else NULL + cdef cyruntime.cudaUUID_t* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not None else NULL with nogil: err = cyruntime.cudaGetExportTable(&ppExportTable, cypExportTableId_ptr) if err != cyruntime.cudaSuccess: @@ -38475,7 +38507,7 @@ def cudaEGLStreamProducerReturnFrame(conn, eglframe : Optional[cudaEglFrame], pS cyconn = conn else: raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) - cdef cyruntime.cudaEglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL + cdef cyruntime.cudaEglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL with nogil: err = cyruntime.cudaEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) return (_cudaError_t(err),)