Skip to content

Commit 251e888

Browse files
committed
Add first set of generated cybind bindings
1 parent d2e782e commit 251e888

4 files changed

Lines changed: 172 additions & 15 deletions

File tree

cuda_bindings/cuda/bindings/cufile.pxd

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44
#
5-
# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly.
5+
# This code was automatically generated with version 13.0.0. Do not modify it directly.
66

77
from libc.stdint cimport intptr_t
88

@@ -74,6 +74,18 @@ cpdef int get_version() except? 0
7474
cpdef size_t get_parameter_size_t(int param) except? 0
7575
cpdef bint get_parameter_bool(int param) except? 0
7676
cpdef str get_parameter_string(int param, int len)
77+
cpdef get_parameter_min_max_value(int param, intptr_t min_value, intptr_t max_value)
7778
cpdef set_parameter_size_t(int param, size_t value)
7879
cpdef set_parameter_bool(int param, bint value)
7980
cpdef set_parameter_string(int param, intptr_t desc_str)
81+
cpdef set_stats_level(int level)
82+
cpdef int get_stats_level() except? 0
83+
cpdef stats_start()
84+
cpdef stats_stop()
85+
cpdef stats_reset()
86+
cpdef get_stats_l1(intptr_t stats)
87+
cpdef get_stats_l2(intptr_t stats)
88+
cpdef get_stats_l3(intptr_t stats)
89+
cpdef size_t get_bar_size_in_kb(int gpu_ind_ex) except? 0
90+
cpdef set_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len)
91+
cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len)

cuda_bindings/cuda/bindings/cufile.pyx

Lines changed: 152 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44
#
5-
# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly.
5+
# This code was automatically generated with version 13.0.0. Do not modify it directly.
66

77
cimport cython # NOQA
88
from libc cimport errno
@@ -1124,7 +1124,7 @@ cpdef driver_get_properties(intptr_t props):
11241124
"""Gets the Driver session properties.
11251125
11261126
Args:
1127-
props (intptr_t): Properties to set.
1127+
props (intptr_t): to set.
11281128
11291129
.. seealso:: `cuFileDriverGetProperties`
11301130
"""
@@ -1273,6 +1273,21 @@ cpdef str get_parameter_string(int param, int len):
12731273
return _desc_str_.decode()
12741274

12751275

1276+
cpdef get_parameter_min_max_value(int param, intptr_t min_value, intptr_t max_value):
1277+
"""Get both the minimum and maximum settable values for a given size_t parameter in a single call.
1278+
1279+
Args:
1280+
param (SizeTConfigParameter): CUfile SizeT configuration parameter.
1281+
min_value (intptr_t): Pointer to store the minimum value.
1282+
max_value (intptr_t): Pointer to store the maximum value.
1283+
1284+
.. seealso:: `cuFileGetParameterMinMaxValue`
1285+
"""
1286+
with nogil:
1287+
status = cuFileGetParameterMinMaxValue(<_SizeTConfigParameter>param, <size_t*>min_value, <size_t*>max_value)
1288+
check_status(status)
1289+
1290+
12761291
cpdef set_parameter_size_t(int param, size_t value):
12771292
with nogil:
12781293
status = cuFileSetParameterSizeT(<_SizeTConfigParameter>param, value)
@@ -1291,6 +1306,141 @@ cpdef set_parameter_string(int param, intptr_t desc_str):
12911306
check_status(status)
12921307

12931308

1309+
cpdef set_stats_level(int level):
1310+
"""Set the level of statistics collection for cuFile operations. This will override the cufile.json settings for stats.
1311+
1312+
Args:
1313+
level (int): Statistics level (0 = disabled, 1 = basic, 2 = detailed, 3 = verbose).
1314+
1315+
.. seealso:: `cuFileSetStatsLevel`
1316+
"""
1317+
with nogil:
1318+
status = cuFileSetStatsLevel(level)
1319+
check_status(status)
1320+
1321+
1322+
cpdef int get_stats_level() except? 0:
1323+
"""Get the current level of statistics collection for cuFile operations.
1324+
1325+
Returns:
1326+
int: Pointer to store the current statistics level.
1327+
1328+
.. seealso:: `cuFileGetStatsLevel`
1329+
"""
1330+
cdef int level
1331+
with nogil:
1332+
status = cuFileGetStatsLevel(&level)
1333+
check_status(status)
1334+
return level
1335+
1336+
1337+
cpdef stats_start():
1338+
"""Start collecting cuFile statistics.
1339+
1340+
.. seealso:: `cuFileStatsStart`
1341+
"""
1342+
with nogil:
1343+
status = cuFileStatsStart()
1344+
check_status(status)
1345+
1346+
1347+
cpdef stats_stop():
1348+
"""Stop collecting cuFile statistics.
1349+
1350+
.. seealso:: `cuFileStatsStop`
1351+
"""
1352+
with nogil:
1353+
status = cuFileStatsStop()
1354+
check_status(status)
1355+
1356+
1357+
cpdef stats_reset():
1358+
"""Reset all cuFile statistics counters.
1359+
1360+
.. seealso:: `cuFileStatsReset`
1361+
"""
1362+
with nogil:
1363+
status = cuFileStatsReset()
1364+
check_status(status)
1365+
1366+
1367+
cpdef get_stats_l1(intptr_t stats):
1368+
"""Get Level 1 cuFile statistics.
1369+
1370+
Args:
1371+
stats (intptr_t): Pointer to CUfileStatsLevel1_t structure to be filled.
1372+
1373+
.. seealso:: `cuFileGetStatsL1`
1374+
"""
1375+
with nogil:
1376+
status = cuFileGetStatsL1(<CUfileStatsLevel1_t*>stats)
1377+
check_status(status)
1378+
1379+
1380+
cpdef get_stats_l2(intptr_t stats):
1381+
"""Get Level 2 cuFile statistics.
1382+
1383+
Args:
1384+
stats (intptr_t): Pointer to CUfileStatsLevel2_t structure to be filled.
1385+
1386+
.. seealso:: `cuFileGetStatsL2`
1387+
"""
1388+
with nogil:
1389+
status = cuFileGetStatsL2(<CUfileStatsLevel2_t*>stats)
1390+
check_status(status)
1391+
1392+
1393+
cpdef get_stats_l3(intptr_t stats):
1394+
"""Get Level 3 cuFile statistics.
1395+
1396+
Args:
1397+
stats (intptr_t): Pointer to CUfileStatsLevel3_t structure to be filled.
1398+
1399+
.. seealso:: `cuFileGetStatsL3`
1400+
"""
1401+
with nogil:
1402+
status = cuFileGetStatsL3(<CUfileStatsLevel3_t*>stats)
1403+
check_status(status)
1404+
1405+
1406+
cpdef size_t get_bar_size_in_kb(int gpu_ind_ex) except? 0:
1407+
cdef size_t bar_size
1408+
with nogil:
1409+
status = cuFileGetBARSizeInKB(gpu_ind_ex, &bar_size)
1410+
check_status(status)
1411+
return bar_size
1412+
1413+
1414+
cpdef set_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len):
1415+
"""Set both POSIX pool slab size and count parameters as a pair.
1416+
1417+
Args:
1418+
size_values (intptr_t): Array of slab sizes in KB.
1419+
count_values (intptr_t): Array of slab counts.
1420+
len (int): Length of both arrays (must be the same).
1421+
1422+
.. seealso:: `cuFileSetParameterPosixPoolSlabArray`
1423+
"""
1424+
with nogil:
1425+
status = cuFileSetParameterPosixPoolSlabArray(<const size_t*>size_values, <const size_t*>count_values, len)
1426+
check_status(status)
1427+
1428+
1429+
cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len):
1430+
"""Get both POSIX pool slab size and count parameters as a pair.
1431+
1432+
Args:
1433+
size_values (intptr_t): Buffer to receive slab sizes in KB.
1434+
count_values (intptr_t): Buffer to receive slab counts.
1435+
len (int): Buffer size (must match the actual parameter length).
1436+
1437+
.. seealso:: `cuFileGetParameterPosixPoolSlabArray`
1438+
"""
1439+
with nogil:
1440+
status = cuFileGetParameterPosixPoolSlabArray(<size_t*>size_values, <size_t*>count_values, len)
1441+
check_status(status)
1442+
1443+
12941444
cpdef str op_status_error(int status):
12951445
"""cufileop status string.
12961446

cuda_bindings/cuda/bindings/cycufile.pxd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44
#
5-
# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly.
5+
# This code was automatically generated with version 13.0.0. Do not modify it directly.
66

77
from libc.stdint cimport uint32_t, uint64_t
88
from libc.time cimport time_t
@@ -353,11 +353,10 @@ cdef CUfileError_t cuFileGetVersion(int* version) except?<CUfileError_t>CUFILE_L
353353
cdef CUfileError_t cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
354354
cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
355355
cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
356+
cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
356357
cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
357358
cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
358359
cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
359-
cdef CUfileError_t cuFileDriverClose() except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
360-
cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
361360
cdef CUfileError_t cuFileSetStatsLevel(int level) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
362361
cdef CUfileError_t cuFileGetStatsLevel(int* level) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil
363362
cdef CUfileError_t cuFileStatsStart() except?<CUfileError_t>CUFILE_LOADING_ERROR nogil

cuda_bindings/cuda/bindings/cycufile.pyx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44
#
5-
# This code was automatically generated across versions from 12.9.0 to 13.0.1. Do not modify it directly.
5+
# This code was automatically generated with version 13.0.0. Do not modify it directly.
66

77
from ._internal cimport cufile as _cufile
88

@@ -122,6 +122,10 @@ cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param,
122122
return _cufile._cuFileGetParameterString(param, desc_str, len)
123123

124124

125+
cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil:
126+
return _cufile._cuFileGetParameterMinMaxValue(param, min_value, max_value)
127+
128+
125129
cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil:
126130
return _cufile._cuFileSetParameterSizeT(param, value)
127131

@@ -134,14 +138,6 @@ cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param,
134138
return _cufile._cuFileSetParameterString(param, desc_str)
135139

136140

137-
cdef CUfileError_t cuFileDriverClose() except?<CUfileError_t>CUFILE_LOADING_ERROR nogil:
138-
return _cufile._cuFileDriverClose()
139-
140-
141-
cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil:
142-
return _cufile._cuFileGetParameterMinMaxValue(param, min_value, max_value)
143-
144-
145141
cdef CUfileError_t cuFileSetStatsLevel(int level) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil:
146142
return _cufile._cuFileSetStatsLevel(level)
147143

0 commit comments

Comments
 (0)