Skip to content

Commit

Permalink
update types in py module
Browse files Browse the repository at this point in the history
  • Loading branch information
inakleinbottle committed Aug 18, 2023
1 parent b77c4be commit fa0a8d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions roughpy/src/args/dlpack_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ convert_to_dl_typecode(scalars::ScalarTypeCode code) noexcept {
return static_cast<uint8_t>(code);
}

constexpr scalars::ScalarDeviceType
constexpr platform::DeviceType
convert_from_dl_device_type(DLDeviceType type) noexcept {
return static_cast<scalars::ScalarDeviceType>(type);
return static_cast<platform::DeviceType>(type);
}

constexpr DLDeviceType
convert_to_dl_device_type(scalars::ScalarDeviceType type) noexcept
convert_to_dl_device_type(platform::DeviceType type) noexcept
{
return static_cast<DLDeviceType>(type);
}
Expand All @@ -53,7 +53,7 @@ convert_to_dl_datatype(const scalars::BasicScalarInfo& info) noexcept
};
}

constexpr scalars::ScalarDeviceInfo
constexpr platform::DeviceInfo
convert_from_dl_device_info(const DLDevice& device) noexcept
{
return {
Expand All @@ -63,7 +63,7 @@ convert_from_dl_device_info(const DLDevice& device) noexcept
}

constexpr DLDevice
convert_to_dl_device_info(const scalars::ScalarDeviceInfo& device) noexcept {
convert_to_dl_device_info(const platform::DeviceInfo& device) noexcept {
return {
convert_to_dl_device_type(device.device_type),
device.device_id
Expand Down
5 changes: 4 additions & 1 deletion roughpy/src/scalars/scalars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ void python::init_scalars(pybind11::module_& m)
* objects.
*/

#define DOCASE(NAME) \
case static_cast<uint8_t>(scalars::ScalarTypeCode::NAME): \
type = scalars::ScalarTypeCode::NAME; \
break

d
static const scalars::ScalarType*
dlpack_dtype_to_scalar_type(DLDataType dtype, DLDevice device)
{
Expand Down

0 comments on commit fa0a8d6

Please sign in to comment.