From 254adfd207f52ecebd6bfbca56a9898f3f1de9b0 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Fri, 4 Dec 2026 13:07:07 -0800 Subject: [PATCH] skip context hash tests for AdaptiveCpp on CUDA AdaptiveCpp hashes a default context by XOR of its device ids, which is 0 for cuda:0, so the context of cuda:0 and the host device hashes like the context of the host device alone. --- dpctl/tests/test_sycl_context.py | 7 +++++++ dpctl/tests/test_sycl_queue.py | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/dpctl/tests/test_sycl_context.py b/dpctl/tests/test_sycl_context.py index a88a685e69..4afdd4d90b 100644 --- a/dpctl/tests/test_sycl_context.py +++ b/dpctl/tests/test_sycl_context.py @@ -26,6 +26,7 @@ from .helper import ( create_invalid_capsule, get_sub_device_or_skip, + is_adaptivecpp, skip_if_usm_unsupported, ) @@ -82,6 +83,12 @@ def test_context_not_equals(): ctx_gpu = dpctl.SyclContext("gpu") except dpctl.SyclContextCreationError: pytest.skip() + if is_adaptivecpp() and any( + d.backend == dpctl.backend_type.cuda for d in ctx_gpu.get_devices() + ): + pytest.skip( + "AdaptiveCpp hashes the contexts of cuda:0 and the CPU equally" + ) try: ctx_cpu = dpctl.SyclContext("cpu") except dpctl.SyclContextCreationError: diff --git a/dpctl/tests/test_sycl_queue.py b/dpctl/tests/test_sycl_queue.py index f6a911ddd3..e9ce4d286b 100644 --- a/dpctl/tests/test_sycl_queue.py +++ b/dpctl/tests/test_sycl_queue.py @@ -98,6 +98,10 @@ def test_context_not_equals(): gpuQ = dpctl.SyclQueue("gpu") except dpctl.SyclQueueCreationError: pytest.skip() + if is_adaptivecpp() and gpuQ.sycl_device.backend == dpctl.backend_type.cuda: + pytest.skip( + "AdaptiveCpp hashes the contexts of cuda:0 and the CPU equally" + ) ctx_gpu = gpuQ.get_sycl_context() try: cpuQ = dpctl.SyclQueue("cpu")