diff --git a/dpctl/apis/include/dpctl4pybind11.hpp b/dpctl/apis/include/dpctl4pybind11.hpp index 256753073c..6fe4049127 100644 --- a/dpctl/apis/include/dpctl4pybind11.hpp +++ b/dpctl/apis/include/dpctl4pybind11.hpp @@ -27,9 +27,9 @@ #include "dpctl_capi.h" #include -#include #include #include +#include #include #include #include @@ -94,9 +94,9 @@ class dpctl_capi void *(*Memory_GetOpaquePointer_)(Py_MemoryObject *); DPCTLSyclContextRef (*Memory_GetContextRef_)(Py_MemoryObject *); DPCTLSyclQueueRef (*Memory_GetQueueRef_)(Py_MemoryObject *); - std::size_t (*Memory_GetNumBytes_)(Py_MemoryObject *); + size_t (*Memory_GetNumBytes_)(Py_MemoryObject *); PyObject *(*Memory_Make_)(DPCTLSyclUSMRef, - std::size_t, + size_t, DPCTLSyclQueueRef, PyObject *); @@ -126,7 +126,7 @@ class dpctl_capi Py_MemoryObject *, py::ssize_t, char); - PyObject *(*UsmNDArray_MakeSimpleFromPtr_)(std::size_t, + PyObject *(*UsmNDArray_MakeSimpleFromPtr_)(size_t, int, DPCTLSyclUSMRef, DPCTLSyclQueueRef, @@ -760,7 +760,7 @@ class usm_memory : public py::object * lifetime of the USM allocation. */ usm_memory(void *usm_ptr, - std::size_t nbytes, + size_t nbytes, const sycl::queue &q, std::shared_ptr shptr) { @@ -820,7 +820,7 @@ class usm_memory : public py::object return reinterpret_cast(MRef); } - std::size_t get_nbytes() const + size_t get_nbytes() const { auto const &api = ::dpctl::detail::dpctl_capi::get(); Py_MemoryObject *mem_obj = reinterpret_cast(m_ptr); @@ -1259,18 +1259,18 @@ struct ManagedMemory } // end of namespace detail -template +template sycl::event keep_args_alive(sycl::queue &q, const py::object (&py_objs)[num], const std::vector &depends = {}) { - std::size_t n_objects_held = 0; + size_t n_objects_held = 0; std::array, num> shp_arr{}; - std::size_t n_usm_owners_held = 0; + size_t n_usm_owners_held = 0; std::array, num> shp_usm{}; - for (std::size_t i = 0; i < num; ++i) { + for (size_t i = 0; i < num; ++i) { const auto &py_obj_i = py_objs[i]; if (detail::ManagedMemory::is_usm_managed_by_shared_ptr(py_obj_i)) { const auto &shp = @@ -1317,7 +1317,7 @@ sycl::event keep_args_alive(sycl::queue &q, cgh.host_task([n_objects_held, shp_arr = std::move(shp_arr)]() { py::gil_scoped_acquire acquire; - for (std::size_t i = 0; i < n_objects_held; ++i) { + for (size_t i = 0; i < n_objects_held; ++i) { shp_arr[i]->dec_ref(); } }); @@ -1329,11 +1329,11 @@ sycl::event keep_args_alive(sycl::queue &q, /*! @brief Check if all allocation queues are the same as the execution queue */ -template +template bool queues_are_compatible(const sycl::queue &exec_q, const sycl::queue (&alloc_qs)[num]) { - for (std::size_t i = 0; i < num; ++i) { + for (size_t i = 0; i < num; ++i) { if (exec_q != alloc_qs[i]) { return false; @@ -1344,11 +1344,11 @@ bool queues_are_compatible(const sycl::queue &exec_q, /*! @brief Check if all allocation queues of usm_ndarays are the same as the execution queue */ -template +template bool queues_are_compatible(const sycl::queue &exec_q, const ::dpctl::tensor::usm_ndarray (&arrs)[num]) { - for (std::size_t i = 0; i < num; ++i) { + for (size_t i = 0; i < num; ++i) { if (exec_q != arrs[i].get_queue()) { return false;