@@ -1258,7 +1258,7 @@ cdef class _py_anon_pod2:
12581258 if self ._readonly:
12591259 raise ValueError (" This _py_anon_pod2 instance is read-only" )
12601260 cdef _py_anon_pod3 val_ = val
1261- memcpy(< void * > & (self ._ptr[0 ].batch), < void * > (val_._ptr) , sizeof(_anon_pod3))
1261+ memcpy(< void * > & (self ._ptr[0 ].batch), < void * > (val_._get_ptr()) , sizeof(_anon_pod3) * 1 )
12621262
12631263 @staticmethod
12641264 def from_data (data ):
@@ -1405,7 +1405,7 @@ cdef class StatsLevel1:
14051405 if self ._readonly:
14061406 raise ValueError (" This StatsLevel1 instance is read-only" )
14071407 cdef OpCounter val_ = val
1408- memcpy(< void * > & (self ._ptr[0 ].read_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1408+ memcpy(< void * > & (self ._ptr[0 ].read_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14091409
14101410 @property
14111411 def write_ops (self ):
@@ -1417,7 +1417,7 @@ cdef class StatsLevel1:
14171417 if self ._readonly:
14181418 raise ValueError (" This StatsLevel1 instance is read-only" )
14191419 cdef OpCounter val_ = val
1420- memcpy(< void * > & (self ._ptr[0 ].write_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1420+ memcpy(< void * > & (self ._ptr[0 ].write_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14211421
14221422 @property
14231423 def hdl_register_ops (self ):
@@ -1429,7 +1429,7 @@ cdef class StatsLevel1:
14291429 if self ._readonly:
14301430 raise ValueError (" This StatsLevel1 instance is read-only" )
14311431 cdef OpCounter val_ = val
1432- memcpy(< void * > & (self ._ptr[0 ].hdl_register_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1432+ memcpy(< void * > & (self ._ptr[0 ].hdl_register_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14331433
14341434 @property
14351435 def hdl_deregister_ops (self ):
@@ -1441,7 +1441,7 @@ cdef class StatsLevel1:
14411441 if self ._readonly:
14421442 raise ValueError (" This StatsLevel1 instance is read-only" )
14431443 cdef OpCounter val_ = val
1444- memcpy(< void * > & (self ._ptr[0 ].hdl_deregister_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1444+ memcpy(< void * > & (self ._ptr[0 ].hdl_deregister_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14451445
14461446 @property
14471447 def buf_register_ops (self ):
@@ -1453,7 +1453,7 @@ cdef class StatsLevel1:
14531453 if self ._readonly:
14541454 raise ValueError (" This StatsLevel1 instance is read-only" )
14551455 cdef OpCounter val_ = val
1456- memcpy(< void * > & (self ._ptr[0 ].buf_register_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1456+ memcpy(< void * > & (self ._ptr[0 ].buf_register_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14571457
14581458 @property
14591459 def buf_deregister_ops (self ):
@@ -1465,7 +1465,7 @@ cdef class StatsLevel1:
14651465 if self ._readonly:
14661466 raise ValueError (" This StatsLevel1 instance is read-only" )
14671467 cdef OpCounter val_ = val
1468- memcpy(< void * > & (self ._ptr[0 ].buf_deregister_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1468+ memcpy(< void * > & (self ._ptr[0 ].buf_deregister_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14691469
14701470 @property
14711471 def batch_submit_ops (self ):
@@ -1477,7 +1477,7 @@ cdef class StatsLevel1:
14771477 if self ._readonly:
14781478 raise ValueError (" This StatsLevel1 instance is read-only" )
14791479 cdef OpCounter val_ = val
1480- memcpy(< void * > & (self ._ptr[0 ].batch_submit_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1480+ memcpy(< void * > & (self ._ptr[0 ].batch_submit_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14811481
14821482 @property
14831483 def batch_complete_ops (self ):
@@ -1489,7 +1489,7 @@ cdef class StatsLevel1:
14891489 if self ._readonly:
14901490 raise ValueError (" This StatsLevel1 instance is read-only" )
14911491 cdef OpCounter val_ = val
1492- memcpy(< void * > & (self ._ptr[0 ].batch_complete_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1492+ memcpy(< void * > & (self ._ptr[0 ].batch_complete_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
14931493
14941494 @property
14951495 def batch_setup_ops (self ):
@@ -1501,7 +1501,7 @@ cdef class StatsLevel1:
15011501 if self ._readonly:
15021502 raise ValueError (" This StatsLevel1 instance is read-only" )
15031503 cdef OpCounter val_ = val
1504- memcpy(< void * > & (self ._ptr[0 ].batch_setup_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1504+ memcpy(< void * > & (self ._ptr[0 ].batch_setup_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15051505
15061506 @property
15071507 def batch_cancel_ops (self ):
@@ -1513,7 +1513,7 @@ cdef class StatsLevel1:
15131513 if self ._readonly:
15141514 raise ValueError (" This StatsLevel1 instance is read-only" )
15151515 cdef OpCounter val_ = val
1516- memcpy(< void * > & (self ._ptr[0 ].batch_cancel_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1516+ memcpy(< void * > & (self ._ptr[0 ].batch_cancel_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15171517
15181518 @property
15191519 def batch_destroy_ops (self ):
@@ -1525,7 +1525,7 @@ cdef class StatsLevel1:
15251525 if self ._readonly:
15261526 raise ValueError (" This StatsLevel1 instance is read-only" )
15271527 cdef OpCounter val_ = val
1528- memcpy(< void * > & (self ._ptr[0 ].batch_destroy_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1528+ memcpy(< void * > & (self ._ptr[0 ].batch_destroy_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15291529
15301530 @property
15311531 def batch_enqueued_ops (self ):
@@ -1537,7 +1537,7 @@ cdef class StatsLevel1:
15371537 if self ._readonly:
15381538 raise ValueError (" This StatsLevel1 instance is read-only" )
15391539 cdef OpCounter val_ = val
1540- memcpy(< void * > & (self ._ptr[0 ].batch_enqueued_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1540+ memcpy(< void * > & (self ._ptr[0 ].batch_enqueued_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15411541
15421542 @property
15431543 def batch_posix_enqueued_ops (self ):
@@ -1549,7 +1549,7 @@ cdef class StatsLevel1:
15491549 if self ._readonly:
15501550 raise ValueError (" This StatsLevel1 instance is read-only" )
15511551 cdef OpCounter val_ = val
1552- memcpy(< void * > & (self ._ptr[0 ].batch_posix_enqueued_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1552+ memcpy(< void * > & (self ._ptr[0 ].batch_posix_enqueued_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15531553
15541554 @property
15551555 def batch_processed_ops (self ):
@@ -1561,7 +1561,7 @@ cdef class StatsLevel1:
15611561 if self ._readonly:
15621562 raise ValueError (" This StatsLevel1 instance is read-only" )
15631563 cdef OpCounter val_ = val
1564- memcpy(< void * > & (self ._ptr[0 ].batch_processed_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1564+ memcpy(< void * > & (self ._ptr[0 ].batch_processed_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15651565
15661566 @property
15671567 def batch_posix_processed_ops (self ):
@@ -1573,7 +1573,7 @@ cdef class StatsLevel1:
15731573 if self ._readonly:
15741574 raise ValueError (" This StatsLevel1 instance is read-only" )
15751575 cdef OpCounter val_ = val
1576- memcpy(< void * > & (self ._ptr[0 ].batch_posix_processed_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1576+ memcpy(< void * > & (self ._ptr[0 ].batch_posix_processed_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15771577
15781578 @property
15791579 def batch_nvfs_submit_ops (self ):
@@ -1585,7 +1585,7 @@ cdef class StatsLevel1:
15851585 if self ._readonly:
15861586 raise ValueError (" This StatsLevel1 instance is read-only" )
15871587 cdef OpCounter val_ = val
1588- memcpy(< void * > & (self ._ptr[0 ].batch_nvfs_submit_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1588+ memcpy(< void * > & (self ._ptr[0 ].batch_nvfs_submit_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
15891589
15901590 @property
15911591 def batch_p2p_submit_ops (self ):
@@ -1597,7 +1597,7 @@ cdef class StatsLevel1:
15971597 if self ._readonly:
15981598 raise ValueError (" This StatsLevel1 instance is read-only" )
15991599 cdef OpCounter val_ = val
1600- memcpy(< void * > & (self ._ptr[0 ].batch_p2p_submit_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1600+ memcpy(< void * > & (self ._ptr[0 ].batch_p2p_submit_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
16011601
16021602 @property
16031603 def batch_aio_submit_ops (self ):
@@ -1609,7 +1609,7 @@ cdef class StatsLevel1:
16091609 if self ._readonly:
16101610 raise ValueError (" This StatsLevel1 instance is read-only" )
16111611 cdef OpCounter val_ = val
1612- memcpy(< void * > & (self ._ptr[0 ].batch_aio_submit_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1612+ memcpy(< void * > & (self ._ptr[0 ].batch_aio_submit_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
16131613
16141614 @property
16151615 def batch_iouring_submit_ops (self ):
@@ -1621,7 +1621,7 @@ cdef class StatsLevel1:
16211621 if self ._readonly:
16221622 raise ValueError (" This StatsLevel1 instance is read-only" )
16231623 cdef OpCounter val_ = val
1624- memcpy(< void * > & (self ._ptr[0 ].batch_iouring_submit_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1624+ memcpy(< void * > & (self ._ptr[0 ].batch_iouring_submit_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
16251625
16261626 @property
16271627 def batch_mixed_io_submit_ops (self ):
@@ -1633,7 +1633,7 @@ cdef class StatsLevel1:
16331633 if self ._readonly:
16341634 raise ValueError (" This StatsLevel1 instance is read-only" )
16351635 cdef OpCounter val_ = val
1636- memcpy(< void * > & (self ._ptr[0 ].batch_mixed_io_submit_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1636+ memcpy(< void * > & (self ._ptr[0 ].batch_mixed_io_submit_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
16371637
16381638 @property
16391639 def batch_total_submit_ops (self ):
@@ -1645,7 +1645,7 @@ cdef class StatsLevel1:
16451645 if self ._readonly:
16461646 raise ValueError (" This StatsLevel1 instance is read-only" )
16471647 cdef OpCounter val_ = val
1648- memcpy(< void * > & (self ._ptr[0 ].batch_total_submit_ops), < void * > (val_._ptr) , sizeof(CUfileOpCounter_t))
1648+ memcpy(< void * > & (self ._ptr[0 ].batch_total_submit_ops), < void * > (val_._get_ptr()) , sizeof(CUfileOpCounter_t) * 1 )
16491649
16501650 @property
16511651 def read_bytes (self ):
@@ -2180,7 +2180,7 @@ cdef class StatsLevel2:
21802180 if self ._readonly:
21812181 raise ValueError (" This StatsLevel2 instance is read-only" )
21822182 cdef StatsLevel1 val_ = val
2183- memcpy(< void * > & (self ._ptr[0 ].basic), < void * > (val_._ptr) , sizeof(CUfileStatsLevel1_t))
2183+ memcpy(< void * > & (self ._ptr[0 ].basic), < void * > (val_._get_ptr()) , sizeof(CUfileStatsLevel1_t) * 1 )
21842184
21852185 @property
21862186 def read_size_kb_hist (self ):
@@ -2193,7 +2193,7 @@ cdef class StatsLevel2:
21932193 def read_size_kb_hist (self , val ):
21942194 if self ._readonly:
21952195 raise ValueError (" This StatsLevel2 instance is read-only" )
2196- cdef view.array arr = view.array(shape = (len (val) ,), itemsize = sizeof(uint64_t), format = " Q" , mode = " c" )
2196+ cdef view.array arr = view.array(shape = (32 ,), itemsize = sizeof(uint64_t), format = " Q" , mode = " c" )
21972197 arr[:] = _numpy.asarray(val, dtype = _numpy.uint64)
21982198 memcpy(< void * > (& (self ._ptr[0 ].read_size_kb_hist)), < void * > (arr.data), sizeof(uint64_t) * len (val))
21992199
@@ -2208,7 +2208,7 @@ cdef class StatsLevel2:
22082208 def write_size_kb_hist (self , val ):
22092209 if self ._readonly:
22102210 raise ValueError (" This StatsLevel2 instance is read-only" )
2211- cdef view.array arr = view.array(shape = (len (val) ,), itemsize = sizeof(uint64_t), format = " Q" , mode = " c" )
2211+ cdef view.array arr = view.array(shape = (32 ,), itemsize = sizeof(uint64_t), format = " Q" , mode = " c" )
22122212 arr[:] = _numpy.asarray(val, dtype = _numpy.uint64)
22132213 memcpy(< void * > (& (self ._ptr[0 ].write_size_kb_hist)), < void * > (arr.data), sizeof(uint64_t) * len (val))
22142214
@@ -2317,19 +2317,21 @@ cdef class StatsLevel3:
23172317 if self ._readonly:
23182318 raise ValueError (" This StatsLevel3 instance is read-only" )
23192319 cdef StatsLevel2 val_ = val
2320- memcpy(< void * > & (self ._ptr[0 ].detailed), < void * > (val_._ptr) , sizeof(CUfileStatsLevel2_t))
2320+ memcpy(< void * > & (self ._ptr[0 ].detailed), < void * > (val_._get_ptr()) , sizeof(CUfileStatsLevel2_t) * 1 )
23212321
23222322 @property
23232323 def per_gpu_stats (self ):
23242324 """ PerGpuStats: """
2325- return PerGpuStats.from_ptr(< intptr_t> & (self ._ptr[0 ].per_gpu_stats), self ._readonly , self )
2325+ return PerGpuStats.from_ptr(< intptr_t> & (self ._ptr[0 ].per_gpu_stats), 16 , self ._readonly )
23262326
23272327 @per_gpu_stats.setter
23282328 def per_gpu_stats (self , val ):
23292329 if self ._readonly:
23302330 raise ValueError (" This StatsLevel3 instance is read-only" )
23312331 cdef PerGpuStats val_ = val
2332- memcpy(< void * > & (self ._ptr[0 ].per_gpu_stats), < void * > (val_._ptr), sizeof(CUfilePerGpuStats_t))
2332+ if len (val) != 16 :
2333+ raise ValueError (f" Expected length 16 for field per_gpu_stats, got {len(val)}" )
2334+ memcpy(< void * > & (self ._ptr[0 ].per_gpu_stats), < void * > (val_._get_ptr()), sizeof(CUfilePerGpuStats_t) * 16 )
23332335
23342336 @property
23352337 def num_gpus (self ):
0 commit comments