27
27
28
28
#include "dpctl_capi.h"
29
29
#include <complex>
30
- #include <cstddef>
31
30
#include <memory>
32
31
#include <pybind11/pybind11.h>
32
+ #include <stddef.h>
33
33
#include <stdexcept>
34
34
#include <sycl/sycl.hpp>
35
35
#include <utility>
@@ -94,9 +94,9 @@ class dpctl_capi
94
94
void * (* Memory_GetOpaquePointer_ )(Py_MemoryObject * );
95
95
DPCTLSyclContextRef (* Memory_GetContextRef_ )(Py_MemoryObject * );
96
96
DPCTLSyclQueueRef (* Memory_GetQueueRef_ )(Py_MemoryObject * );
97
- std :: size_t (* Memory_GetNumBytes_ )(Py_MemoryObject * );
97
+ size_t (* Memory_GetNumBytes_ )(Py_MemoryObject * );
98
98
PyObject * (* Memory_Make_ )(DPCTLSyclUSMRef ,
99
- std :: size_t ,
99
+ size_t ,
100
100
DPCTLSyclQueueRef ,
101
101
PyObject * );
102
102
@@ -126,7 +126,7 @@ class dpctl_capi
126
126
Py_MemoryObject * ,
127
127
py ::ssize_t ,
128
128
char );
129
- PyObject * (* UsmNDArray_MakeSimpleFromPtr_ )(std :: size_t ,
129
+ PyObject * (* UsmNDArray_MakeSimpleFromPtr_ )(size_t ,
130
130
int ,
131
131
DPCTLSyclUSMRef ,
132
132
DPCTLSyclQueueRef ,
@@ -760,7 +760,7 @@ class usm_memory : public py::object
760
760
* lifetime of the USM allocation.
761
761
*/
762
762
usm_memory (void * usm_ptr ,
763
- std :: size_t nbytes ,
763
+ size_t nbytes ,
764
764
const sycl ::queue & q ,
765
765
std ::shared_ptr < void > shptr )
766
766
{
@@ -820,7 +820,7 @@ class usm_memory : public py::object
820
820
return reinterpret_cast < char * > (MRef );
821
821
}
822
822
823
- std :: size_t get_nbytes () const
823
+ size_t get_nbytes () const
824
824
{
825
825
auto const & api = ::dpctl ::detail ::dpctl_capi ::get ();
826
826
Py_MemoryObject * mem_obj = reinterpret_cast < Py_MemoryObject * > (m_ptr );
@@ -1259,18 +1259,18 @@ struct ManagedMemory
1259
1259
1260
1260
} // end of namespace detail
1261
1261
1262
- template < std :: size_t num >
1262
+ template < size_t num >
1263
1263
sycl ::event keep_args_alive (sycl ::queue & q ,
1264
1264
const py ::object (& py_objs )[num ],
1265
1265
const std ::vector < sycl ::event > & depends = {})
1266
1266
{
1267
- std :: size_t n_objects_held = 0 ;
1267
+ size_t n_objects_held = 0 ;
1268
1268
std ::array < std ::shared_ptr < py ::handle > , num > shp_arr {};
1269
1269
1270
- std :: size_t n_usm_owners_held = 0 ;
1270
+ size_t n_usm_owners_held = 0 ;
1271
1271
std ::array < std ::shared_ptr < void > , num > shp_usm {};
1272
1272
1273
- for (std :: size_t i = 0 ; i < num ; ++ i ) {
1273
+ for (size_t i = 0 ; i < num ; ++ i ) {
1274
1274
const auto & py_obj_i = py_objs [i ];
1275
1275
if (detail ::ManagedMemory ::is_usm_managed_by_shared_ptr (py_obj_i )) {
1276
1276
const auto & shp =
@@ -1317,7 +1317,7 @@ sycl::event keep_args_alive(sycl::queue &q,
1317
1317
cgh .host_task ([n_objects_held , shp_arr = std ::move (shp_arr )]() {
1318
1318
py ::gil_scoped_acquire acquire ;
1319
1319
1320
- for (std :: size_t i = 0 ; i < n_objects_held ; ++ i ) {
1320
+ for (size_t i = 0 ; i < n_objects_held ; ++ i ) {
1321
1321
shp_arr [i ]-> dec_ref ();
1322
1322
}
1323
1323
});
@@ -1329,11 +1329,11 @@ sycl::event keep_args_alive(sycl::queue &q,
1329
1329
1330
1330
/*! @brief Check if all allocation queues are the same as the
1331
1331
execution queue */
1332
- template < std :: size_t num >
1332
+ template < size_t num >
1333
1333
bool queues_are_compatible (const sycl ::queue & exec_q ,
1334
1334
const sycl ::queue (& alloc_qs )[num ])
1335
1335
{
1336
- for (std :: size_t i = 0 ; i < num ; ++ i ) {
1336
+ for (size_t i = 0 ; i < num ; ++ i ) {
1337
1337
1338
1338
if (exec_q != alloc_qs [i ]) {
1339
1339
return false;
@@ -1344,11 +1344,11 @@ bool queues_are_compatible(const sycl::queue &exec_q,
1344
1344
1345
1345
/*! @brief Check if all allocation queues of usm_ndarays are the same as
1346
1346
the execution queue */
1347
- template < std :: size_t num >
1347
+ template < size_t num >
1348
1348
bool queues_are_compatible (const sycl ::queue & exec_q ,
1349
1349
const ::dpctl ::tensor ::usm_ndarray (& arrs )[num ])
1350
1350
{
1351
- for (std :: size_t i = 0 ; i < num ; ++ i ) {
1351
+ for (size_t i = 0 ; i < num ; ++ i ) {
1352
1352
1353
1353
if (exec_q != arrs [i ].get_queue ()) {
1354
1354
return false;
0 commit comments