From 923d4044d47b1f19ccb3738ccd116aedf52f19d5 Mon Sep 17 00:00:00 2001 From: Alexey Bader Date: Wed, 29 Dec 2021 14:32:49 +0300 Subject: [PATCH] Check that program is built once for "fused" case If context is shared among a root device and its subdevices, we expect runtime library to build the program once and re-use the result to run the program on all devices. --- SYCL/Basic/subdevice_pi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SYCL/Basic/subdevice_pi.cpp b/SYCL/Basic/subdevice_pi.cpp index dee9c4e907..1b48e45fa8 100644 --- a/SYCL/Basic/subdevice_pi.cpp +++ b/SYCL/Basic/subdevice_pi.cpp @@ -1,7 +1,7 @@ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %CPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 %t.out separate equally %CPU_CHECK_PLACEHOLDER --check-prefix CHECK-SEPARATE // RUN: %CPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 %t.out shared equally %CPU_CHECK_PLACEHOLDER --check-prefix CHECK-SHARED --implicit-check-not piContextCreate --implicit-check-not piMemBufferCreate -// RUN: %CPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 %t.out fused equally %CPU_CHECK_PLACEHOLDER --check-prefix CHECK-FUSED --implicit-check-not piContextCreate --implicit-check-not piMemBufferCreate +// RUN: %CPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 %t.out fused equally %CPU_CHECK_PLACEHOLDER --check-prefix CHECK-FUSED --implicit-check-not piProgramBuild --implicit-check-not piContextCreate --implicit-check-not piMemBufferCreate // // Intel OpenCL CPU Runtime supports device partition on all (multi-core) // platforms. Other devices may not support this. @@ -146,8 +146,10 @@ static bool check_fused_context(device dev, buffer buf, context fused_context(devices); // CHECK-FUSED: Create fused context // CHECK-FUSED: ---> piContextCreate + // CHECK-FUSED: ---> piProgramBuild // - // Make sure that a single context is created: see --implicit-check-not above. + // Make sure that a single context is created and device code is built only + // once: see --implicit-check-not above. log_pi("Test root device"); {