We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a92200f commit 7cd209dCopy full SHA for 7cd209d
1 file changed
runtime/core/test/device_memory_buffer_test.cpp
@@ -82,7 +82,12 @@ class DeviceMemoryBufferTest : public ::testing::Test {
82
protected:
83
static void SetUpTestSuite() {
84
executorch::runtime::runtime_init();
85
- register_device_allocator(&g_mock_cuda);
+ // On platforms like AppleMac xctest, the same process may be reused
86
+ // across test invocations, so the static registry persists and
87
+ // re-registering would abort. Only register once.
88
+ if (get_device_allocator(DeviceType::CUDA) == nullptr) {
89
+ register_device_allocator(&g_mock_cuda);
90
+ }
91
}
92
93
void SetUp() override {
0 commit comments