Skip to content

Commit 7f50ff2

Browse files
authored
[SYCL][CUDA] fix compilation of CUDA plugin on Windows with MSVC (#10809)
Compilation failed on Windows with Visual Studio 2019/2022 when enabling the CUDA plugin. This commit fixes compilation by * adding missing headers * adding a static_cast of ContextInfoType to fix the following compilation error: sycl\plugins\unified_runtime\ur\adapters\cuda\context.cpp(49): error C2397: conversion from 'ur_context_info_t' to 'uint32_t' requires a narrowing conversion
1 parent e07deff commit 7f50ff2

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

sycl/plugins/unified_runtime/ur/adapters/cuda/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo(
4646
size_t propSize, void *pContextInfo, size_t *pPropSizeRet) {
4747
UrReturnHelper ReturnValue(propSize, pContextInfo, pPropSizeRet);
4848

49-
switch (uint32_t{ContextInfoType}) {
49+
switch (static_cast<uint32_t>(ContextInfoType)) {
5050
case UR_CONTEXT_INFO_NUM_DEVICES:
5151
return ReturnValue(1);
5252
case UR_CONTEXT_INFO_DEVICES:

sycl/plugins/unified_runtime/ur/adapters/cuda/device.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===-----------------------------------------------------------------===//
88

9+
#include <array>
910
#include <cassert>
1011
#include <sstream>
1112

sycl/plugins/unified_runtime/ur/adapters/cuda/kernel.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <cuda.h>
1111
#include <ur_api.h>
1212

13+
#include <array>
1314
#include <atomic>
1415
#include <cassert>
1516
#include <numeric>

sycl/plugins/unified_runtime/ur/adapters/cuda/queue.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <ur/ur.hpp>
1111

12+
#include <algorithm>
1213
#include <cuda.h>
1314
#include <vector>
1415

0 commit comments

Comments
 (0)