Skip to content

Conversation

@CHAIYD-2025
Copy link
Collaborator

Note: Some adjustments are temporary for CUDA 8.0 support and need to be updatated in the future.

Note: Some adjustments are temporary for CUDA 8.0 support and need to be updatated in the future.
Comment on lines 501 to 533
py::tuple get_device_capability(int device_index = 0) {
return py::make_tuple(8, 0);
}
} // namespace aipu

struct _DeviceGuard {
_DeviceGuard(int index, int prev_index) : idx(index), prev_idx(prev_index) {}

int idx = 0;
int prev_idx = -1;
};

struct _Device {
_Device(c10::Device device) { idx = device.index(); }
_Device(int index) { idx = index; }

int idx = 0;
int prev_idx = -1;
};

static std::unordered_map<int, at::Generator> default_generators = {
{0, at::detail::getDefaultCPUGenerator()}};

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("device_count", &aipu::device_count, "aipu device count");
m.def("is_available", &aipu::is_available, "aipu is available");
m.def("current_device", &aipu::current_device, "aipu current device");
m.def("get_device_name", &aipu::get_device_name,
"Return the name of the AIPU backend");
// This change is a temporary adaptation for CUDA 8.0
// Need to do
m.def("get_device_capability", &aipu::get_device_capability,
py::arg("device") = 0, "Return the capability pf the AIPU backend");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the meaning of the abbreviation "pf”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write error,should be “of”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants