From 29527f8dccaa2fb26b8c7b495fe3f12ef84b34a2 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Wed, 22 Dec 2021 21:41:33 +0300 Subject: [PATCH 1/4] [SYCL][XPTI] Fix test --- SYCL/XPTI/basic_event_collection.cpp | 3 ++- SYCL/lit.cfg.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SYCL/XPTI/basic_event_collection.cpp b/SYCL/XPTI/basic_event_collection.cpp index 9e8907bcb3..d3bf89d2d3 100644 --- a/SYCL/XPTI/basic_event_collection.cpp +++ b/SYCL/XPTI/basic_event_collection.cpp @@ -1,5 +1,5 @@ // REQUIRES: xptifw, opencl -// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll +// RUN: %clangxx -fsycl %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.dll env SYCL_DEVICE_FILTER=opencl %t.out | FileCheck %s 2>&1 @@ -36,6 +36,7 @@ int main() { #endif +// CHECK: xptiTraceInit: Stream Name = sycl.experimental.mem_alloc // CHECK: xptiTraceInit: Stream Name = sycl // CHECK-NEXT: Graph create // CHECK-NEXT: xptiTraceInit: Stream Name = sycl.pi diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index a98725d441..d2b36d64f5 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -342,7 +342,7 @@ config.available_features.add('xptifw') config.substitutions.append(('%xptifw_dispatcher', xptifw_dispatcher)) if platform.system() == "Linux": - config.substitutions.append(('%xptifw_lib', " {}/xptifw.lib".format(xptifw_lib_dir))) + config.substitutions.append(('%xptifw_lib', " {}/libxpti.a".format(xptifw_lib_dir))) elif platform.system() == "Windows": config.substitutions.append(('%xptifw_lib', "-L{} -I{} -lxptifw".format(xptifw_lib_dir, xptifw_includes))) From bb663bde1a80644e24996634f1edc0391794829e Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Wed, 22 Dec 2021 21:54:08 +0300 Subject: [PATCH 2/4] Support CL-options format --- SYCL/XPTI/basic_event_collection.cpp | 2 +- SYCL/lit.cfg.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SYCL/XPTI/basic_event_collection.cpp b/SYCL/XPTI/basic_event_collection.cpp index d3bf89d2d3..6bfe0192dc 100644 --- a/SYCL/XPTI/basic_event_collection.cpp +++ b/SYCL/XPTI/basic_event_collection.cpp @@ -1,5 +1,5 @@ // REQUIRES: xptifw, opencl -// RUN: %clangxx -fsycl %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll +// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.dll env SYCL_DEVICE_FILTER=opencl %t.out | FileCheck %s 2>&1 diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index d2b36d64f5..80b39b5c79 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -342,9 +342,12 @@ config.available_features.add('xptifw') config.substitutions.append(('%xptifw_dispatcher', xptifw_dispatcher)) if platform.system() == "Linux": - config.substitutions.append(('%xptifw_lib', " {}/libxpti.a".format(xptifw_lib_dir))) + config.substitutions.append(('%xptifw_lib', " {}/libxpti.a -I{} ".format(xptifw_lib_dir, xptifw_includes))) elif platform.system() == "Windows": - config.substitutions.append(('%xptifw_lib', "-L{} -I{} -lxptifw".format(xptifw_lib_dir, xptifw_includes))) + if cl_options: + config.substitutions.append(('%xptifw_lib', " {}/xpti.lib /I{} ".format(xptifw_lib_dir, xptifw_includes))) + else: + config.substitutions.append(('%xptifw_lib', " {}/xpti.lib -I{} ".format(xptifw_lib_dir, xptifw_includes))) llvm_tools = ["llvm-spirv", "llvm-link"] From db86d8692fc0bfc444888edc126a1e0505aaa0b4 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Wed, 22 Dec 2021 22:12:29 +0300 Subject: [PATCH 3/4] Enable test back --- SYCL/XPTI/basic_event_collection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SYCL/XPTI/basic_event_collection.cpp b/SYCL/XPTI/basic_event_collection.cpp index ba0fbaf111..6bfe0192dc 100644 --- a/SYCL/XPTI/basic_event_collection.cpp +++ b/SYCL/XPTI/basic_event_collection.cpp @@ -1,4 +1,4 @@ -// REQUIRES: xptifw, opencl, TEMPORARILY_DISABLED +// REQUIRES: xptifw, opencl // RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll // RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.dll env SYCL_DEVICE_FILTER=opencl %t.out | FileCheck %s 2>&1 From b455adfd2559959563e2323ab9d4cc383c26616d Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Thu, 23 Dec 2021 09:09:53 +0300 Subject: [PATCH 4/4] Apply review comments --- SYCL/lit.cfg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index 80b39b5c79..8b242112ce 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -342,12 +342,12 @@ config.available_features.add('xptifw') config.substitutions.append(('%xptifw_dispatcher', xptifw_dispatcher)) if platform.system() == "Linux": - config.substitutions.append(('%xptifw_lib', " {}/libxpti.a -I{} ".format(xptifw_lib_dir, xptifw_includes))) + config.substitutions.append(('%xptifw_lib', " -L{} -lxptifw -I{} ".format(xptifw_lib_dir, xptifw_includes))) elif platform.system() == "Windows": if cl_options: - config.substitutions.append(('%xptifw_lib', " {}/xpti.lib /I{} ".format(xptifw_lib_dir, xptifw_includes))) + config.substitutions.append(('%xptifw_lib', " {}/xptifw.lib /I{} ".format(xptifw_lib_dir, xptifw_includes))) else: - config.substitutions.append(('%xptifw_lib', " {}/xpti.lib -I{} ".format(xptifw_lib_dir, xptifw_includes))) + config.substitutions.append(('%xptifw_lib', " {}/xptifw.lib -I{} ".format(xptifw_lib_dir, xptifw_includes))) llvm_tools = ["llvm-spirv", "llvm-link"]