Skip to content

Commit 1732459

Browse files
committed
Expose the LARGEST_MEMBLOCK property in python.
1 parent 5882289 commit 1732459

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

pygpu/gpuarray.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ cdef extern from "gpuarray/buffer.h":
103103
int GA_CTX_PROP_MAXGSIZE0
104104
int GA_CTX_PROP_MAXGSIZE1
105105
int GA_CTX_PROP_MAXGSIZE2
106+
int GA_CTX_PROP_LARGEST_MEMBLOCK
106107

107108
int GA_BUFFER_PROP_SIZE
108109

pygpu/gpuarray.pyx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,13 @@ cdef class GpuContext:
11461146
ctx_property(self, GA_CTX_PROP_MAXGSIZE2, &res)
11471147
return res
11481148

1149+
property largest_memblock:
1150+
"Size of the largest memory block you can allocate"
1151+
def __get__(self):
1152+
cdef size_t res
1153+
ctx_property(self, GA_CTX_PROP_LARGEST_MEMBLOCK, &res)
1154+
return res
1155+
11491156

11501157
cdef class flags(object):
11511158
cdef int fl

0 commit comments

Comments
 (0)