1 #include <gtest/gtest.h> 2 3 #include <ATen/ATen.h> 4 #include <c10/core/DispatchKeySet.h> 5 6 #include <vector> 7 8 using at::DispatchKey; 9 using at::DispatchKeySet; 10 TEST(DispatchKeySetTest,TestGetRuntimeDispatchKeySet)11TEST(DispatchKeySetTest, TestGetRuntimeDispatchKeySet) { 12 // Check if getRuntimeDispatchKeySet and runtimeDispatchKeySetHas agree. 13 for (auto dk1: DispatchKeySet(DispatchKeySet::FULL)) { 14 auto dks = getRuntimeDispatchKeySet(dk1); 15 for (auto dk2: DispatchKeySet(DispatchKeySet::FULL)) { 16 ASSERT_EQ(dks.has(dk2), runtimeDispatchKeySetHas(dk1, dk2)); 17 } 18 } 19 } 20