@@ -65,6 +65,8 @@ cdef extern from "gpuarray/error.h":
6565 GA_UNALIGNED_ERROR, GA_COPY_ERROR, GA_COMM_ERROR
6666
6767cdef extern from " gpuarray/buffer.h" :
68+ ctypedef struct gpucontext_props:
69+ pass
6870 ctypedef struct gpucontext:
6971 pass
7072 ctypedef struct gpudata:
@@ -74,7 +76,17 @@ cdef extern from "gpuarray/buffer.h":
7476
7577 int gpu_get_platform_count(const char * name, unsigned int * platcount)
7678 int gpu_get_device_count(const char * name, unsigned int platform, unsigned int * devcount)
77- gpucontext * gpucontext_init(const char * name, int devno, int flags, int * ret)
79+
80+ int gpucontext_props_new(gpucontext_props ** res)
81+ int gpucontext_props_cuda_dev(gpucontext_props * p, int devno)
82+ int gpucontext_props_opencl_dev(gpucontext_props * p, int platno, int devno)
83+ int gpucontext_props_sched(gpucontext_props * p, int sched)
84+ int gpucontext_props_set_single_stream(gpucontext_props * p)
85+ int gpucontext_props_kernel_cache(gpucontext_props * p, const char * path)
86+ int gpucontext_props_alloc_cache(gpucontext_props * p, size_t initial, size_t max )
87+ void gpucontext_props_del(gpucontext_props * p)
88+
89+ int gpucontext_init(gpucontext ** res, const char * name, gpucontext_props * p)
7890 void gpucontext_deref(gpucontext * ctx)
7991 char * gpucontext_error(gpucontext * ctx, int err)
8092 int gpudata_property(gpudata * ctx, int prop_id, void * res)
@@ -83,18 +95,14 @@ cdef extern from "gpuarray/buffer.h":
8395 gpucontext * gpudata_context(gpudata * )
8496 gpucontext * gpukernel_context(gpukernel * )
8597
86- int GA_CTX_DEFAULT
87- int GA_CTX_MULTI_THREAD
88- int GA_CTX_SINGLE_THREAD
89- int GA_CTX_SINGLE_STREAM
90- int GA_CTX_DISABLE_ALLOCATION_CACHE
98+ int GA_CTX_SCHED_AUTO
99+ int GA_CTX_SCHED_SINGLE
100+ int GA_CTX_SCHED_MULTI
91101
92102 int GA_CTX_PROP_DEVNAME
93- int GA_CTX_PROP_PCIBUSID
94- int GA_CTX_PROP_MAXLSIZE
103+ int GA_CTX_PROP_UNIQUE_ID
95104 int GA_CTX_PROP_LMEMSIZE
96105 int GA_CTX_PROP_NUMPROCS
97- int GA_CTX_PROP_MAXGSIZE
98106 int GA_CTX_PROP_BIN_ID
99107 int GA_CTX_PROP_TOTAL_GMEM
100108 int GA_CTX_PROP_FREE_GMEM
@@ -114,8 +122,8 @@ cdef extern from "gpuarray/buffer.h":
114122 int GA_KERNEL_PROP_TYPES
115123
116124 cdef enum ga_usefl:
117- GA_USE_CLUDA, GA_USE_SMALL, GA_USE_DOUBLE, GA_USE_COMPLEX, GA_USE_HALF,
118- GA_USE_BINARY, GA_USE_CUDA, GA_USE_OPENCL
125+ GA_USE_SMALL, GA_USE_DOUBLE, GA_USE_COMPLEX, GA_USE_HALF,
126+ GA_USE_CUDA, GA_USE_OPENCL
119127
120128cdef extern from " gpuarray/kernel.h" :
121129 ctypedef struct _GpuKernel " GpuKernel" :
@@ -131,7 +139,6 @@ cdef extern from "gpuarray/kernel.h":
131139 int GpuKernel_call(_GpuKernel * k, unsigned int n,
132140 const size_t * gs, const size_t * ls,
133141 size_t shared, void ** args)
134- int GpuKernel_binary(_GpuKernel * , size_t * , void ** )
135142
136143cdef extern from " gpuarray/array.h" :
137144 ctypedef struct _GpuArray " GpuArray" :
@@ -165,10 +172,6 @@ cdef extern from "gpuarray/array.h":
165172 gpudata * data, size_t offset, int typecode,
166173 unsigned int nd, const size_t * dims,
167174 const ssize_t * strides, int writable)
168- int GpuArray_copy_from_host(_GpuArray * a,
169- gpucontext * ctx, void * buf, int typecode,
170- unsigned int nd, const size_t * dims,
171- const ssize_t * strides) nogil
172175 int GpuArray_view(_GpuArray * v, _GpuArray * a)
173176 int GpuArray_sync(_GpuArray * a) nogil
174177 int GpuArray_index(_GpuArray * r, _GpuArray * a, const ssize_t * starts,
@@ -234,10 +237,6 @@ cdef int array_fromdata(GpuArray a,
234237 gpudata * data, size_t offset, int typecode,
235238 unsigned int nd, const size_t * dims,
236239 const ssize_t * strides, int writeable) except - 1
237- cdef int array_copy_from_host(GpuArray a,
238- gpucontext * ctx, void * buf, int typecode,
239- unsigned int nd, const size_t * dims,
240- const ssize_t * strides) except - 1
241240cdef int array_view(GpuArray v, GpuArray a) except - 1
242241cdef int array_sync(GpuArray a) except - 1
243242cdef int array_index(GpuArray r, GpuArray a, const ssize_t * starts,
@@ -271,7 +270,6 @@ cdef int kernel_sched(GpuKernel k, size_t n, size_t *gs, size_t *ls) except -1
271270cdef int kernel_call(GpuKernel k, unsigned int n,
272271 const size_t * gs, const size_t * ls,
273272 size_t shared, void ** args) except - 1
274- cdef int kernel_binary(GpuKernel k, size_t * , void ** ) except - 1
275273cdef int kernel_property(GpuKernel k, int prop_id, void * res) except - 1
276274
277275cdef int ctx_property(GpuContext c, int prop_id, void * res) except - 1
@@ -281,19 +279,14 @@ cdef api GpuContext pygpu_default_context()
281279
282280cdef api bint pygpu_GpuArray_Check(object o)
283281
284- cdef api GpuContext pygpu_init(object dev, int flags )
282+ cdef api GpuContext pygpu_init(object dev, gpucontext_props * p )
285283
286284cdef api GpuArray pygpu_zeros(unsigned int nd, const size_t * dims,
287285 int typecode, ga_order order,
288286 GpuContext context, object cls )
289287cdef api GpuArray pygpu_empty(unsigned int nd, const size_t * dims,
290288 int typecode, ga_order order,
291289 GpuContext context, object cls )
292- cdef api GpuArray pygpu_fromhostdata(void * buf, int typecode, unsigned int nd,
293- const size_t * dims,
294- const ssize_t * strides,
295- GpuContext context, object cls )
296-
297290cdef api GpuArray pygpu_fromgpudata(gpudata * buf, size_t offset, int typecode,
298291 unsigned int nd, const size_t * dims,
299292 const ssize_t * strides, GpuContext context,
0 commit comments