@@ -1146,12 +1146,13 @@ def memory_map_exit(self, exc_type, exc_val, exc_tb):
11461146 if get_cl_header_version () >= (2 , 0 ):
11471147 svmallocation_old_init = SVMAllocation .__init__
11481148
1149- def svmallocation_init (self , ctx , size , alignment , flags , _interface = None ):
1149+ def svmallocation_init (self , ctx , size , alignment , flags , _interface = None ,
1150+ queue = None ):
11501151 """
11511152 :arg ctx: a :class:`Context`
11521153 :arg flags: some of :class:`svm_mem_flags`.
11531154 """
1154- svmallocation_old_init (self , ctx , size , alignment , flags )
1155+ svmallocation_old_init (self , ctx , size , alignment , flags , queue )
11551156
11561157 # mem_flags.READ_ONLY applies to kernels, not the host
11571158 read_write = True
@@ -1996,7 +1997,7 @@ def enqueue_svm_migratemem(queue, svms, flags, wait_for=None):
19961997 wait_for )
19971998
19981999
1999- def svm_empty (ctx , flags , shape , dtype , order = "C" , alignment = None ):
2000+ def svm_empty (ctx , flags , shape , dtype , order = "C" , alignment = None , queue = None ):
20002001 """Allocate an empty :class:`numpy.ndarray` of the given *shape*, *dtype*
20012002 and *order*. (See :func:`numpy.empty` for the meaning of these arguments.)
20022003 The array will be allocated in shared virtual memory belonging
@@ -2014,6 +2015,10 @@ def svm_empty(ctx, flags, shape, dtype, order="C", alignment=None):
20142015 will likely want to wrap the returned array in an :class:`SVM` tag.
20152016
20162017 .. versionadded:: 2016.2
2018+
2019+ .. versionchanged:: 2022.2
2020+
2021+ *queue* argument added.
20172022 """
20182023
20192024 dtype = np .dtype (dtype )
@@ -2060,7 +2065,8 @@ def svm_empty(ctx, flags, shape, dtype, order="C", alignment=None):
20602065 if alignment is None :
20612066 alignment = itemsize
20622067
2063- svm_alloc = SVMAllocation (ctx , nbytes , alignment , flags , _interface = interface )
2068+ svm_alloc = SVMAllocation (ctx , nbytes , alignment , flags , _interface = interface ,
2069+ queue = queue )
20642070 return np .asarray (svm_alloc )
20652071
20662072
0 commit comments