mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
consolidate ATen/test/dispatch_key_set_test.cpp with rest of DispatchKeySet tests (#151697)
Doesn't seem to be a reason to have two test files for this. Differential Revision: [D73274020](https://our.internmc.facebook.com/intern/diff/D73274020/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/151697 Approved by: https://github.com/Skylion007 ghstack dependencies: #151626, #151627, #151628, #151629, #151630
This commit is contained in:
parent
9c2ac2b876
commit
8eb21dffa9
|
|
@ -17,7 +17,6 @@ list(APPEND ATen_CPU_TEST_SRCS
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/cpu_generator_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cpu_profiling_allocator_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cpu_rng_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dispatch_key_set_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dlconvertor_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/extension_backend_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/half_test.cpp
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
#include <gtest/gtest.h>
|
||||
|
||||
#include <ATen/ATen.h>
|
||||
#include <c10/core/DispatchKeySet.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
using at::DispatchKey;
|
||||
using at::DispatchKeySet;
|
||||
|
||||
TEST(DispatchKeySetTest, TestGetRuntimeDispatchKeySet) {
|
||||
// Check if getRuntimeDispatchKeySet and runtimeDispatchKeySetHas agree.
|
||||
for (auto dk1: DispatchKeySet(DispatchKeySet::FULL)) {
|
||||
auto dks = getRuntimeDispatchKeySet(dk1);
|
||||
for (auto dk2: DispatchKeySet(DispatchKeySet::FULL)) {
|
||||
ASSERT_EQ(dks.has(dk2), runtimeDispatchKeySetHas(dk1, dk2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -443,3 +443,13 @@ TEST(DispatchKeySet, TestFunctionalityDispatchKeyToString) {
|
|||
seen_strings.insert(res);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(DispatchKeySet, TestGetRuntimeDispatchKeySet) {
|
||||
// Check if getRuntimeDispatchKeySet and runtimeDispatchKeySetHas agree.
|
||||
for (auto dk1 : DispatchKeySet(DispatchKeySet::FULL)) {
|
||||
auto dks = getRuntimeDispatchKeySet(dk1);
|
||||
for (auto dk2 : DispatchKeySet(DispatchKeySet::FULL)) {
|
||||
ASSERT_EQ(dks.has(dk2), runtimeDispatchKeySetHas(dk1, dk2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user