Skip to content

Commit 823d991

Browse files
committed
cleanup and clang-format
1 parent 7d94e69 commit 823d991

File tree

7 files changed

+31
-47
lines changed

7 files changed

+31
-47
lines changed

sycl-jit/jit-compiler/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,3 @@ if(NOT MSVC AND NOT APPLE)
9797
sycl-jit PRIVATE "-Wl,--version-script=${linker_script}")
9898
set_target_properties(sycl-jit PROPERTIES LINK_DEPENDS ${linker_script})
9999
endif()
100-
101-
# Ensure output directory is set correctly for Windows
102-
# set_target_properties(sycl-jit PROPERTIES
103-
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
104-
# LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
105-
# ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
106-
#)

sycl-jit/jit-compiler/include/KernelFusion.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@ extern "C" {
6464

6565
#ifdef _MSC_VER
6666
#pragma warning(push)
67-
#pragma warning(disable: 4190)
67+
#pragma warning(disable : 4190)
6868
#endif // _MSC_VER
6969

70-
KF_EXPORT_SYMBOL JITResult fuseKernels(View<SYCLKernelInfo> KernelInformation,
71-
const char *FusedKernelName,
72-
View<ParameterIdentity> Identities,
73-
BarrierFlags BarriersFlags,
74-
View<ParameterInternalization> Internalization,
75-
View<jit_compiler::JITConstant> JITConstants);
70+
KF_EXPORT_SYMBOL JITResult
71+
fuseKernels(View<SYCLKernelInfo> KernelInformation, const char *FusedKernelName,
72+
View<ParameterIdentity> Identities, BarrierFlags BarriersFlags,
73+
View<ParameterInternalization> Internalization,
74+
View<jit_compiler::JITConstant> JITConstants);
7675

77-
KF_EXPORT_SYMBOL JITResult materializeSpecConstants(const char *KernelName,
78-
jit_compiler::SYCLKernelBinaryInfo &BinInfo,
79-
View<unsigned char> SpecConstBlob);
76+
KF_EXPORT_SYMBOL JITResult materializeSpecConstants(
77+
const char *KernelName, jit_compiler::SYCLKernelBinaryInfo &BinInfo,
78+
View<unsigned char> SpecConstBlob);
8079

81-
KF_EXPORT_SYMBOL JITResult compileSYCL(InMemoryFile SourceFile, View<InMemoryFile> IncludeFiles,
82-
View<const char *> UserArgs);
80+
KF_EXPORT_SYMBOL JITResult compileSYCL(InMemoryFile SourceFile,
81+
View<InMemoryFile> IncludeFiles,
82+
View<const char *> UserArgs);
8383

8484
/// Clear all previously set options.
8585
KF_EXPORT_SYMBOL void resetJITConfiguration();

sycl-jit/jit-compiler/lib/KernelFusion.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ static bool isTargetFormatSupported(BinaryFormat TargetFormat) {
7171
}
7272
}
7373

74-
extern "C" KF_EXPORT_SYMBOL JITResult
75-
materializeSpecConstants(const char *KernelName,
76-
jit_compiler::SYCLKernelBinaryInfo &BinInfo,
77-
View<unsigned char> SpecConstBlob) {
74+
extern "C" KF_EXPORT_SYMBOL JITResult materializeSpecConstants(
75+
const char *KernelName, jit_compiler::SYCLKernelBinaryInfo &BinInfo,
76+
View<unsigned char> SpecConstBlob) {
7877
auto &JITCtx = JITContext::getInstance();
7978

8079
TargetInfo TargetInfo = ConfigHelper::get<option::JITTargetInfo>();
@@ -115,12 +114,11 @@ materializeSpecConstants(const char *KernelName,
115114
return JITResult{MaterializerKernelInfo};
116115
}
117116

118-
extern "C" KF_EXPORT_SYMBOL JITResult fuseKernels(View<SYCLKernelInfo> KernelInformation,
119-
const char *FusedKernelName,
120-
View<ParameterIdentity> Identities,
121-
BarrierFlags BarriersFlags,
122-
View<ParameterInternalization> Internalization,
123-
View<jit_compiler::JITConstant> Constants) {
117+
extern "C" KF_EXPORT_SYMBOL JITResult
118+
fuseKernels(View<SYCLKernelInfo> KernelInformation, const char *FusedKernelName,
119+
View<ParameterIdentity> Identities, BarrierFlags BarriersFlags,
120+
View<ParameterInternalization> Internalization,
121+
View<jit_compiler::JITConstant> Constants) {
124122

125123
std::vector<std::string> KernelsToFuse;
126124
llvm::transform(KernelInformation, std::back_inserter(KernelsToFuse),
@@ -236,9 +234,9 @@ extern "C" KF_EXPORT_SYMBOL JITResult fuseKernels(View<SYCLKernelInfo> KernelInf
236234
return JITResult{FusedKernelInfo};
237235
}
238236

239-
extern "C" KF_EXPORT_SYMBOL JITResult compileSYCL(InMemoryFile SourceFile,
240-
View<InMemoryFile> IncludeFiles,
241-
View<const char *> UserArgs) {
237+
extern "C" KF_EXPORT_SYMBOL JITResult
238+
compileSYCL(InMemoryFile SourceFile, View<InMemoryFile> IncludeFiles,
239+
View<const char *> UserArgs) {
242240
auto ModuleOrErr = compileDeviceCode(SourceFile, IncludeFiles, UserArgs);
243241
if (!ModuleOrErr) {
244242
return errorToFusionResult(ModuleOrErr.takeError(),
@@ -261,7 +259,9 @@ extern "C" KF_EXPORT_SYMBOL JITResult compileSYCL(InMemoryFile SourceFile,
261259
return JITResult{Kernel};
262260
}
263261

264-
extern "C" KF_EXPORT_SYMBOL void resetJITConfiguration() { ConfigHelper::reset(); }
262+
extern "C" KF_EXPORT_SYMBOL void resetJITConfiguration() {
263+
ConfigHelper::reset();
264+
}
265265

266266
extern "C" KF_EXPORT_SYMBOL void addToJITConfiguration(OptionStorage &&Opt) {
267267
ConfigHelper::getConfig().set(std::move(Opt));

sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#include <clang/Tooling/CompilationDatabase.h>
1616
#include <clang/Tooling/Tooling.h>
1717

18-
// CP - remove
19-
#include <iostream>
20-
2118
#ifdef _GNU_SOURCE
2219
#include <dlfcn.h>
2320
static char X; // Dummy symbol, used as an anchor for `dlinfo` below.
@@ -27,11 +24,8 @@ static char X; // Dummy symbol, used as an anchor for `dlinfo` below.
2724
#include <filesystem> // For std::filesystem::path ( C++17 only )
2825
#include <shlwapi.h> // For PathRemoveFileSpec
2926
#include <windows.h> // For GetModuleFileName, HMODULE, DWORD, MAX_PATH
30-
// #include <cassert> // For assert
31-
// #include <string> // For std::wstring
3227

3328
// cribbed from sycl/source/detail/os_util.cpp
34-
// TODO: Just inline it.
3529
using OSModuleHandle = intptr_t;
3630
static constexpr OSModuleHandle ExeModuleHandle = -1;
3731
static OSModuleHandle getOSModuleHandle(const void *VirtAddr) {
@@ -95,8 +89,6 @@ static const std::string &getDPCPPRoot() {
9589
DPCPPRoot = std::filesystem::path(getCurrentDSODir()).parent_path().string();
9690
#endif // _WIN32
9791

98-
std::cout << "DPCPPRoot: " << DPCPPRoot << std::endl;
99-
10092
// TODO: Implemenent other means of determining the DPCPP root, e.g.
10193
// evaluating the `CMPLR_ROOT` env.
10294

sycl/source/detail/jit_compiler.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ static inline void printPerformanceWarning(const std::string &Message) {
3131

3232
jit_compiler::jit_compiler() {
3333
auto checkJITLibrary = [this]() -> bool {
34-
// TODO: For Windows, we need to look for a libary by a different name.
3534
#ifdef _WIN32
3635
static const std::string dir = sycl::detail::OSUtil::getCurrentDSODir();
37-
static const std::string JITLibraryName = dir + "\\" + "sycl-jit.dll";
36+
static const std::string JITLibraryName = dir + "\\" + "sycl-jit.dll";
3837
#else
3938
static const std::string JITLibraryName = "libsycl-jit.so";
4039
#endif
@@ -45,7 +44,6 @@ jit_compiler::jit_compiler() {
4544
return false;
4645
}
4746

48-
4947
this->AddToConfigHandle = reinterpret_cast<AddToConfigFuncT>(
5048
sycl::detail::ur::getOsLibraryFuncAddress(LibraryPtr,
5149
"addToJITConfiguration"));
@@ -54,7 +52,6 @@ jit_compiler::jit_compiler() {
5452
"Cannot resolve JIT library function entry point");
5553
return false;
5654
}
57-
5855

5956
this->ResetConfigHandle = reinterpret_cast<ResetConfigFuncT>(
6057
sycl::detail::ur::getOsLibraryFuncAddress(LibraryPtr,

sycl/source/detail/os_util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ std::string OSUtil::getDirName(const char *Path) {
148148
#elif defined(__SYCL_RT_OS_WINDOWS)
149149

150150
/// Returns an absolute path where the object was found.
151-
// ur_win_proxy_loader.dll uses this same logic. If it is changed
152-
// significantly, it might be wise to change it there too.
151+
// ur_win_proxy_loader.dll and sycl-jit.dll use this same logic. If it is
152+
// changed significantly, it might be wise to change it there too.
153153
std::string OSUtil::getCurrentDSODir() {
154154
char Path[MAX_PATH];
155155
Path[0] = '\0';

sycl/source/detail/windows_os_utils.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#include <shlwapi.h>
1212

13+
// ur_proxy_loader.dll and sycl-jit.dll use this same logic. If it changed
14+
// significantly, then it'd be wise to update those versions as well.
1315
using OSModuleHandle = intptr_t;
1416
constexpr OSModuleHandle ExeModuleHandle = -1;
1517
inline OSModuleHandle getOSModuleHandle(const void *VirtAddr) {

0 commit comments

Comments
 (0)