Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cuda_bindings/cuda/bindings/cufile.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,15 @@ cpdef str get_parameter_string(int param, int len)
cpdef set_parameter_size_t(int param, size_t value)
cpdef set_parameter_bool(int param, bint value)
cpdef set_parameter_string(int param, intptr_t desc_str)
cpdef get_parameter_min_max_value(int param, intptr_t min_value, intptr_t max_value)
cpdef set_stats_level(int level)
cpdef int get_stats_level() except? 0
cpdef stats_start()
cpdef stats_stop()
cpdef stats_reset()
cpdef get_stats_l1(intptr_t stats)
cpdef get_stats_l2(intptr_t stats)
cpdef get_stats_l3(intptr_t stats)
cpdef size_t get_bar_size_in_kb(int gpu_ind_ex) except? 0
cpdef set_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len)
cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len)
150 changes: 150 additions & 0 deletions cuda_bindings/cuda/bindings/cufile.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,156 @@ cpdef set_parameter_string(int param, intptr_t desc_str):
check_status(__status__)


cpdef get_parameter_min_max_value(int param, intptr_t min_value, intptr_t max_value):
"""Get both the minimum and maximum settable values for a given size_t parameter in a single call.

Args:
param (SizeTConfigParameter): CUfile SizeT configuration parameter.
min_value (intptr_t): Pointer to store the minimum value.
max_value (intptr_t): Pointer to store the maximum value.

.. seealso:: `cuFileGetParameterMinMaxValue`
"""
with nogil:
__status__ = cuFileGetParameterMinMaxValue(<_SizeTConfigParameter>param, <size_t*>min_value, <size_t*>max_value)
check_status(__status__)


cpdef set_stats_level(int level):
"""Set the level of statistics collection for cuFile operations. This will override the cufile.json settings for stats.

Args:
level (int): Statistics level (0 = disabled, 1 = basic, 2 = detailed, 3 = verbose).

.. seealso:: `cuFileSetStatsLevel`
"""
with nogil:
__status__ = cuFileSetStatsLevel(level)
check_status(__status__)


cpdef int get_stats_level() except? 0:
"""Get the current level of statistics collection for cuFile operations.

Returns:
int: Pointer to store the current statistics level.

.. seealso:: `cuFileGetStatsLevel`
"""
cdef int level
with nogil:
__status__ = cuFileGetStatsLevel(&level)
check_status(__status__)
return level


cpdef stats_start():
"""Start collecting cuFile statistics.

.. seealso:: `cuFileStatsStart`
"""
with nogil:
__status__ = cuFileStatsStart()
check_status(__status__)


cpdef stats_stop():
"""Stop collecting cuFile statistics.

.. seealso:: `cuFileStatsStop`
"""
with nogil:
__status__ = cuFileStatsStop()
check_status(__status__)


cpdef stats_reset():
"""Reset all cuFile statistics counters.

.. seealso:: `cuFileStatsReset`
"""
with nogil:
__status__ = cuFileStatsReset()
check_status(__status__)


cpdef get_stats_l1(intptr_t stats):
"""Get Level 1 cuFile statistics.

Args:
stats (intptr_t): Pointer to CUfileStatsLevel1_t structure to be filled.

.. seealso:: `cuFileGetStatsL1`
"""
with nogil:
__status__ = cuFileGetStatsL1(<CUfileStatsLevel1_t*>stats)
check_status(__status__)


cpdef get_stats_l2(intptr_t stats):
"""Get Level 2 cuFile statistics.

Args:
stats (intptr_t): Pointer to CUfileStatsLevel2_t structure to be filled.

.. seealso:: `cuFileGetStatsL2`
"""
with nogil:
__status__ = cuFileGetStatsL2(<CUfileStatsLevel2_t*>stats)
check_status(__status__)


cpdef get_stats_l3(intptr_t stats):
"""Get Level 3 cuFile statistics.

Args:
stats (intptr_t): Pointer to CUfileStatsLevel3_t structure to be filled.

.. seealso:: `cuFileGetStatsL3`
"""
with nogil:
__status__ = cuFileGetStatsL3(<CUfileStatsLevel3_t*>stats)
check_status(__status__)


cpdef size_t get_bar_size_in_kb(int gpu_ind_ex) except? 0:
cdef size_t bar_size
with nogil:
__status__ = cuFileGetBARSizeInKB(gpu_ind_ex, &bar_size)
check_status(__status__)
return bar_size


cpdef set_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len):
"""Set both POSIX pool slab size and count parameters as a pair.

Args:
size_values (intptr_t): Array of slab sizes in KB.
count_values (intptr_t): Array of slab counts.
len (int): Length of both arrays (must be the same).

.. seealso:: `cuFileSetParameterPosixPoolSlabArray`
"""
with nogil:
__status__ = cuFileSetParameterPosixPoolSlabArray(<const size_t*>size_values, <const size_t*>count_values, len)
check_status(__status__)


cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len):
"""Get both POSIX pool slab size and count parameters as a pair.

Args:
size_values (intptr_t): Buffer to receive slab sizes in KB.
count_values (intptr_t): Buffer to receive slab counts.
len (int): Buffer size (must match the actual parameter length).

.. seealso:: `cuFileGetParameterPosixPoolSlabArray`
"""
with nogil:
__status__ = cuFileGetParameterPosixPoolSlabArray(<size_t*>size_values, <size_t*>count_values, len)
check_status(__status__)


cpdef str op_status_error(int status):
"""cufileop status string.

Expand Down
Loading
Loading