File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -390,27 +390,31 @@ PyObject* THPAutograd_initExtension(PyObject* _unused, PyObject* unused) {
390390 m.def (" _supported_activities" , []() {
391391 std::set<torch::profiler::impl::ActivityType> activities{
392392 torch::profiler::impl::ActivityType::CPU};
393- #if defined(USE_KINETO)
394- #if (!defined(LIBKINETO_NOCUPTI) || !defined(LIBKINETO_NOROCTRACER))
393+ #if defined(USE_KINETO) && \
394+ (!defined (LIBKINETO_NOCUPTI) || !defined (LIBKINETO_NOROCTRACER))
395+ if (at::hasMTIA ()) {
396+ activities.insert (torch::profiler::impl::ActivityType::MTIA);
397+ }
398+ if (at::hasHPU ()) {
399+ activities.insert (torch::profiler::impl::ActivityType::HPU);
400+ }
395401 if (at::getNumGPUs () > 0 ) {
396402 activities.insert (torch::profiler::impl::ActivityType::CUDA);
397403 }
398- #endif // (!defined(LIBKINETO_NOCUPTI) || !defined(LIBKINETO_NOROCTRACER))
399- #if (!defined(LIBKINETO_NOXPUPTI))
404+ #elif defined(USE_KINETO)
400405 if (at::hasXPU ()) {
401406 activities.insert (torch::profiler::impl::ActivityType::XPU);
402407 }
403- #endif // (!defined(LIBKINETO_NOXPUPTI))
404- if (at::hasMTIA ()) {
405- activities.insert (torch::profiler::impl::ActivityType::MTIA);
406- }
407408 if (at::hasHPU ()) {
408409 activities.insert (torch::profiler::impl::ActivityType::HPU);
409410 }
411+ if (at::hasMTIA ()) {
412+ activities.insert (torch::profiler::impl::ActivityType::MTIA);
413+ }
410414 if (c10::get_privateuse1_backend () != " privateuseone" ) {
411415 activities.insert (torch::profiler::impl::ActivityType::PrivateUse1);
412416 }
413- #endif // defined(USE_KINETO)
417+ #endif
414418 return activities;
415419 });
416420
You can’t perform that action at this time.
0 commit comments