Skip to content

Commit a8590e2

Browse files
committed
Merge from 'sycl' to 'sycl-web' (13 commits)
2 parents 149c072 + 78405de commit a8590e2

31 files changed

+336
-255
lines changed

.github/workflows/sycl-windows-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
if: always()
8888
shell: powershell
8989
run: |
90-
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1"
90+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"}
9191
powershell.exe -File windows_detect_hung_tests.ps1
9292
$exitCode = $LASTEXITCODE
9393
Remove-Item -Path "windows_detect_hung_tests.ps1"
@@ -230,7 +230,7 @@ jobs:
230230
if: always()
231231
shell: powershell
232232
run: |
233-
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1"
233+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"}
234234
powershell.exe -File windows_detect_hung_tests.ps1
235235
$exitCode = $LASTEXITCODE
236236
Remove-Item -Path "windows_detect_hung_tests.ps1"

.github/workflows/sycl-windows-run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
if: always()
103103
shell: powershell
104104
run: |
105-
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1"
105+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"}
106106
powershell.exe -File windows_detect_hung_tests.ps1
107107
$exitCode = $LASTEXITCODE
108108
Remove-Item -Path "windows_detect_hung_tests.ps1"
@@ -236,7 +236,7 @@ jobs:
236236
if: always()
237237
shell: powershell
238238
run: |
239-
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1"
239+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"}
240240
powershell.exe -File windows_detect_hung_tests.ps1
241241
$exitCode = $LASTEXITCODE
242242
Remove-Item -Path "windows_detect_hung_tests.ps1"

llvm/lib/SYCLLowerIR/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ if (NOT TARGET LLVMGenXIntrinsics)
4747
endif()
4848
endif (NOT TARGET LLVMGenXIntrinsics)
4949

50-
set_property(GLOBAL PROPERTY LLVMGenXIntrinsics_SOURCE_PROP ${LLVMGenXIntrinsics_SOURCE_DIR})
51-
set_property(GLOBAL PROPERTY LLVMGenXIntrinsics_BINARY_PROP ${LLVMGenXIntrinsics_BINARY_DIR})
52-
5350
add_llvm_component_library(LLVMSYCLLowerIR
5451
ESIMD/ESIMDOptimizeVecArgCallConv.cpp
5552
ESIMD/ESIMDUtils.cpp

sycl/include/sycl/vector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ template <typename DataT> class vec_base<DataT, 1> {
287287

288288
protected:
289289
static constexpr int alignment = (std::min)((size_t)64, sizeof(DataType));
290-
alignas(alignment) DataType m_Data{};
290+
alignas(alignment) DataType m_Data;
291291

292292
public:
293293
constexpr vec_base() = default;

sycl/source/detail/device_impl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ namespace detail {
2121

2222
/// Constructs a SYCL device instance using the provided
2323
/// UR device instance.
24-
device_impl::device_impl(ur_device_handle_t Device, platform_impl &Platform)
24+
device_impl::device_impl(ur_device_handle_t Device, platform_impl &Platform,
25+
device_impl::private_tag)
2526
: MDevice(Device), MPlatform(Platform.shared_from_this()),
2627
MDeviceHostBaseTime(std::make_pair(0, 0)) {
2728
const AdapterPtr &Adapter = Platform.getAdapter();

sycl/source/detail/device_impl.hpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@ class platform_impl;
3333

3434
// TODO: Make code thread-safe
3535
class device_impl {
36+
struct private_tag {
37+
explicit private_tag() = default;
38+
};
39+
friend class platform_impl;
40+
3641
public:
3742
/// Constructs a SYCL device instance using the provided
3843
/// UR device instance.
39-
explicit device_impl(ur_device_handle_t Device, platform_impl &Platform);
44+
//
45+
// Must be called through `platform_impl::getOrMakeDeviceImpl` only.
46+
// `private_tag` ensures that is true.
47+
explicit device_impl(ur_device_handle_t Device, platform_impl &Platform,
48+
private_tag);
4049

4150
~device_impl();
4251

sycl/source/detail/helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ retrieveKernelBinary(const QueueImplPtr &Queue, const char *KernelName,
8787
auto DeviceImpl = Queue->getDeviceImplPtr();
8888
auto Device = detail::createSyclObjFromImpl<device>(DeviceImpl);
8989
DeviceImage = &detail::ProgramManager::getInstance().getDeviceImage(
90-
KernelName, ContextImpl, Device);
90+
KernelName, ContextImpl, DeviceImpl.get());
9191
Program = detail::ProgramManager::getInstance().createURProgram(
9292
*DeviceImage, ContextImpl, {std::move(Device)});
9393
}

sycl/source/detail/kernel_compiler/kernel_compiler_opencl.cpp

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,40 @@ static std::unique_ptr<void, std::function<void(void *)>>
7070

7171
void loadOclocLibrary(const std::vector<uint32_t> &IPVersionVec) {
7272
#ifdef __SYCL_RT_OS_WINDOWS
73-
static const std::string OclocPath = "ocloc64.dll";
73+
// first the environment, if not compatible will move on to absolute path.
74+
static const std::vector<std::string> OclocPaths = {
75+
"ocloc64.dll",
76+
"C:\\Program Files (x86)\\Intel\\oneAPI\\ocloc\\latest\\ocloc64.dll"};
7477
#else
75-
static const std::string OclocPath = "libocloc.so";
78+
static const std::vector<std::string> OclocPaths = {"libocloc.so"};
7679
#endif
7780

78-
// set OclocLibrary value by side effect.
79-
try {
80-
// Load then perform checks. Each check throws.
81-
void *tempPtr = sycl::detail::ur::loadOsLibrary(OclocPath);
82-
OclocLibrary.reset(tempPtr);
81+
// attemptLoad() sets OclocLibrary value by side effect.
82+
auto attemptLoad = [&](std::string OclocPath) {
83+
try {
84+
// Load then perform checks. Each check throws.
85+
void *tempPtr = sycl::detail::ur::loadOsLibrary(OclocPath);
86+
OclocLibrary.reset(tempPtr);
8387

84-
if (tempPtr == nullptr)
85-
throw sycl::exception(make_error_code(errc::build),
86-
"Unable to load ocloc from " + OclocPath);
88+
if (tempPtr == nullptr)
89+
throw sycl::exception(make_error_code(errc::build),
90+
"Unable to load ocloc from " + OclocPath);
8791

88-
checkOclocLibrary(tempPtr);
92+
checkOclocLibrary(tempPtr);
8993

90-
InvokeOclocQuery(IPVersionVec, "CL_DEVICE_OPENCL_C_ALL_VERSIONS");
91-
} catch (const sycl::exception &) {
92-
OclocLibrary.reset(nullptr);
93-
std::rethrow_exception(std::current_exception());
94+
InvokeOclocQuery(IPVersionVec, "CL_DEVICE_OPENCL_C_ALL_VERSIONS");
95+
} catch (const sycl::exception &) {
96+
OclocLibrary.reset(nullptr);
97+
return false;
98+
}
99+
return true;
100+
};
101+
for (auto result : OclocPaths) {
102+
if (attemptLoad(result))
103+
return; // exit on successful attempt
94104
}
105+
// If we haven't exited yet, then throw to indicate failure.
106+
throw sycl::exception(make_error_code(errc::build), "Unable to load ocloc");
95107
}
96108

97109
bool OpenCLC_Compilation_Available(const std::vector<uint32_t> &IPVersionVec) {

sycl/source/detail/memory_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,8 @@ getOrBuildProgramForDeviceGlobal(QueueImplPtr Queue,
12231223
// If there was no cached program, build one.
12241224
auto Context = createSyclObjFromImpl<context>(ContextImpl);
12251225
ProgramManager &PM = ProgramManager::getInstance();
1226-
RTDeviceBinaryImage &Img =
1227-
PM.getDeviceImage(DeviceGlobalEntry->MImages, ContextImpl, Device);
1226+
RTDeviceBinaryImage &Img = PM.getDeviceImage(
1227+
DeviceGlobalEntry->MImages, ContextImpl, getSyclObjImpl(Device).get());
12281228
device_image_plain DeviceImage =
12291229
PM.getDeviceImageFromBinaryImage(&Img, Context, Device);
12301230
device_image_plain BuiltImage =

sycl/source/detail/platform_impl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ platform_impl::getOrMakeDeviceImpl(ur_device_handle_t UrDevice) {
304304
return Result;
305305

306306
// Otherwise make the impl
307-
Result = std::make_shared<device_impl>(UrDevice, *this);
307+
Result = std::make_shared<device_impl>(UrDevice, *this,
308+
device_impl::private_tag{});
308309
MDeviceCache.emplace_back(Result);
309310

310311
return Result;

0 commit comments

Comments
 (0)