Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 2606dbe

Browse files
committed
windows?
1 parent 7c018cb commit 2606dbe

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

SYCL/XPTI/basic_event_collection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS -L%xptifw_lib -I%xptifw_includes -shared %fPIC -std=c++17 -o %t_collector.dll -lxptifw
2+
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
33
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
44
// 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
55

SYCL/lit.cfg.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@
143143
config.substitutions.append( ('%debug_option', '/DEBUG' ) )
144144
config.substitutions.append( ('%cxx_std_option', '/std:' ) )
145145
config.substitutions.append( ('%fPIC', '') )
146+
config.substitutions.append( ('%shared_lib', '/LD') )
146147
else:
147148
config.substitutions.append( ('%sycl_options', ' -lsycl -I' +
148149
config.sycl_include + ' -I' + os.path.join(config.sycl_include, 'sycl')) )
149150
config.substitutions.append( ('%include_option', '-include' ) )
150151
config.substitutions.append( ('%debug_option', '-g' ) )
151152
config.substitutions.append( ('%cxx_std_option', '-std=' ) )
152153
config.substitutions.append( ('%fPIC', '-fPIC') )
154+
config.substitutions.append( ('%shared_lib', '-shared') )
153155

154156
if not config.gpu_aot_target_opts:
155157
config.gpu_aot_target_opts = '"-device *"'
@@ -329,17 +331,21 @@
329331
config.available_features.add('sycl-ls')
330332

331333
# TODO properly set XPTIFW include and runtime dirs
332-
xptifw_lib = os.path.join(config.dpcpp_root_dir, 'lib')
334+
xptifw_lib_dir = os.path.join(config.dpcpp_root_dir, 'lib')
333335
xptifw_dispatcher = ""
334336
if platform.system() == "Linux":
335-
xptifw_dispatcher = os.path.join(xptifw_lib, 'libxptifw.so')
337+
xptifw_dispatcher = os.path.join(xptifw_lib_dir, 'libxptifw.so')
336338
elif platform.system() == "Windows":
337339
xptifw_dispatcher = os.path.join(config.dpcpp_root_dir, 'bin', 'xptifw.dll')
338340
xptifw_includes = os.path.join(config.dpcpp_root_dir, 'include')
339341
if os.path.exists(xptifw_lib) and os.path.exists(os.path.join(xptifw_includes, 'xpti', 'xpti_trace_framework.h')):
340342
config.available_features.add('xptifw')
341-
config.substitutions.append(('%xptifw_lib', "-L{} -I{}".format(xptifw_lib, xptifw_includes)))
342343
config.substitutions.append(('%xptifw_dispatcher', xptifw_dispatcher))
344+
if platform.system() == "Linux":
345+
config.substitutions.append(('%xptifw_lib', " {}/xptifw.lib".format(xptifw_lib_dir)))
346+
elif platform.system() == "Windows":
347+
config.substitutions.append(('%xptifw_lib', "-L{} -I{} -lxptifw".format(xptifw_lib_dir, xptifw_includes)))
348+
343349

344350
llvm_tools = ["llvm-spirv", "llvm-link"]
345351
for llvm_tool in llvm_tools:

0 commit comments

Comments
 (0)