Skip to content

Commit 2b3aaab

Browse files
authored
Merge pull request #2302 from callumfare/callum/revert_ur_2100
Revert #2100 "Raise MSVC warning level from /W3 to /W4"
2 parents f0c1db6 + 19c3afa commit 2b3aaab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+214
-262
lines changed

cmake/helpers.cmake

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,18 @@ function(add_ur_target_compile_options name)
9999
elseif(MSVC)
100100
target_compile_options(${name} PRIVATE
101101
$<$<CXX_COMPILER_ID:MSVC>:/MP> # clang-cl.exe does not support /MP
102-
/W4
103-
/wd4456 # Disable: declaration of 'identifier' hides previous local declaration
104-
/wd4457 # Disable: declaration of 'identifier' hides function parameter
105-
/wd4458 # Disable: declaration of 'identifier' hides class member
106-
/wd4459 # Disable: declaration of 'identifier' hides global declaration
102+
/W3
107103
/MD$<$<CONFIG:Debug>:d>
108104
/GS
109105
/DWIN32_LEAN_AND_MEAN
110106
/DNOMINMAX
111107
)
112108

113-
target_compile_definitions(${name} PRIVATE
114-
# _CRT_SECURE_NO_WARNINGS used mainly because of getenv
115-
_CRT_SECURE_NO_WARNINGS
116-
)
117-
118109
if(UR_DEVELOPER_MODE)
110+
# _CRT_SECURE_NO_WARNINGS used mainly because of getenv
111+
# C4267: The compiler detected a conversion from size_t to a smaller type.
119112
target_compile_options(${name} PRIVATE
120-
/WX /GS
113+
/WX /GS /D_CRT_SECURE_NO_WARNINGS /wd4267
121114
)
122115
endif()
123116
endif()

examples/collector/collector.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@
2525
#include <string_view>
2626

2727
#include "ur_api.h"
28-
29-
#ifdef _MSC_VER
30-
#pragma warning(disable : 4245)
31-
#endif
3228
#include "xpti/xpti_trace_framework.h"
33-
#ifdef _MSC_VER
34-
#pragma warning(default : 4245)
35-
#endif
3629

3730
constexpr uint16_t TRACE_FN_BEGIN =
3831
static_cast<uint16_t>(xpti::trace_point_type_t::function_with_args_begin);

include/ur_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ typedef struct ur_physical_mem_handle_t_ *ur_physical_mem_handle_t;
424424
///////////////////////////////////////////////////////////////////////////////
425425
#ifndef UR_BIT
426426
/// @brief Generic macro for enumerator bit masks
427-
#define UR_BIT(_i) (1U << _i)
427+
#define UR_BIT(_i) (1 << _i)
428428
#endif // UR_BIT
429429

430430
///////////////////////////////////////////////////////////////////////////////

scripts/core/common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ name: "$x_physical_mem_handle_t"
134134
type: macro
135135
desc: "Generic macro for enumerator bit masks"
136136
name: "$X_BIT( _i )"
137-
value: "( 1U << _i )"
137+
value: "( 1 << _i )"
138138
--- #--------------------------------------------------------------------------
139139
type: enum
140140
desc: "Defines Return/Error codes"

source/adapters/cuda/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,15 @@ if (UR_ENABLE_TRACING)
9797
get_target_property(XPTI_SRC_DIR xpti SOURCE_DIR)
9898
set(XPTI_PROXY_SRC "${XPTI_SRC_DIR}/xpti_proxy.cpp")
9999
endif()
100-
add_library(cuda-xpti-proxy STATIC ${XPTI_PROXY_SRC})
101-
target_compile_definitions(cuda-xpti-proxy PRIVATE
100+
target_compile_definitions(${TARGET_NAME} PRIVATE
102101
XPTI_ENABLE_INSTRUMENTATION
103102
XPTI_STATIC_LIBRARY
104103
)
105-
target_include_directories(cuda-xpti-proxy PRIVATE
104+
target_include_directories(${TARGET_NAME} PRIVATE
106105
${XPTI_INCLUDES}
107106
${CUDA_CUPTI_INCLUDE_DIR}
108107
)
109-
target_link_libraries(${TARGET_NAME} PRIVATE cuda-xpti-proxy)
108+
target_sources(${TARGET_NAME} PRIVATE ${XPTI_PROXY_SRC})
110109
endif()
111110

112111
if (CUDA_cupti_LIBRARY)

source/adapters/cuda/command_buffer.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static ur_result_t enqueueCommandBufferFillHelper(
242242
if ((PatternSize == 1) || (PatternSize == 2) || (PatternSize == 4)) {
243243
CUDA_MEMSET_NODE_PARAMS NodeParams = {};
244244
NodeParams.dst = DstPtr;
245-
NodeParams.elementSize = static_cast<unsigned int>(PatternSize);
245+
NodeParams.elementSize = PatternSize;
246246
NodeParams.height = N;
247247
NodeParams.pitch = PatternSize;
248248
NodeParams.width = 1;
@@ -508,12 +508,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
508508
auto &ArgIndices = hKernel->getArgIndices();
509509
CUDA_KERNEL_NODE_PARAMS NodeParams = {};
510510
NodeParams.func = CuFunc;
511-
NodeParams.gridDimX = static_cast<unsigned int>(BlocksPerGrid[0]);
512-
NodeParams.gridDimY = static_cast<unsigned int>(BlocksPerGrid[1]);
513-
NodeParams.gridDimZ = static_cast<unsigned int>(BlocksPerGrid[2]);
514-
NodeParams.blockDimX = static_cast<unsigned int>(ThreadsPerBlock[0]);
515-
NodeParams.blockDimY = static_cast<unsigned int>(ThreadsPerBlock[1]);
516-
NodeParams.blockDimZ = static_cast<unsigned int>(ThreadsPerBlock[2]);
511+
NodeParams.gridDimX = BlocksPerGrid[0];
512+
NodeParams.gridDimY = BlocksPerGrid[1];
513+
NodeParams.gridDimZ = BlocksPerGrid[2];
514+
NodeParams.blockDimX = ThreadsPerBlock[0];
515+
NodeParams.blockDimY = ThreadsPerBlock[1];
516+
NodeParams.blockDimZ = ThreadsPerBlock[2];
517517
NodeParams.sharedMemBytes = LocalSize;
518518
NodeParams.kernelParams = const_cast<void **>(ArgIndices.data());
519519

@@ -1397,12 +1397,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp(
13971397
CUDA_KERNEL_NODE_PARAMS &Params = KernelCommandHandle->Params;
13981398

13991399
Params.func = CuFunc;
1400-
Params.gridDimX = static_cast<unsigned int>(BlocksPerGrid[0]);
1401-
Params.gridDimY = static_cast<unsigned int>(BlocksPerGrid[1]);
1402-
Params.gridDimZ = static_cast<unsigned int>(BlocksPerGrid[2]);
1403-
Params.blockDimX = static_cast<unsigned int>(ThreadsPerBlock[0]);
1404-
Params.blockDimY = static_cast<unsigned int>(ThreadsPerBlock[1]);
1405-
Params.blockDimZ = static_cast<unsigned int>(ThreadsPerBlock[2]);
1400+
Params.gridDimX = BlocksPerGrid[0];
1401+
Params.gridDimY = BlocksPerGrid[1];
1402+
Params.gridDimZ = BlocksPerGrid[2];
1403+
Params.blockDimX = ThreadsPerBlock[0];
1404+
Params.blockDimY = ThreadsPerBlock[1];
1405+
Params.blockDimZ = ThreadsPerBlock[2];
14061406
Params.sharedMemBytes = KernelCommandHandle->Kernel->getLocalSize();
14071407
Params.kernelParams =
14081408
const_cast<void **>(KernelCommandHandle->Kernel->getArgIndices().data());

source/adapters/cuda/device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform,
11521152

11531153
try {
11541154
if (pNumDevices) {
1155-
*pNumDevices = static_cast<uint32_t>(NumDevices);
1155+
*pNumDevices = NumDevices;
11561156
}
11571157

11581158
if (ReturnDevices && phDevices) {
@@ -1235,7 +1235,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle(
12351235
ur_result_t UR_APICALL urDeviceGetGlobalTimestamps(ur_device_handle_t hDevice,
12361236
uint64_t *pDeviceTimestamp,
12371237
uint64_t *pHostTimestamp) {
1238-
CUevent Event{};
1238+
CUevent Event;
12391239
ScopedContext Active(hDevice);
12401240

12411241
if (pDeviceTimestamp) {

source/adapters/cuda/enqueue.cpp

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void guessLocalWorkSize(ur_device_handle_t Device, size_t *ThreadsPerBlock,
160160
int MinGrid, MaxBlockSize;
161161
UR_CHECK_ERROR(cuOccupancyMaxPotentialBlockSize(
162162
&MinGrid, &MaxBlockSize, Kernel->get(), NULL, Kernel->getLocalSize(),
163-
static_cast<int>(MaxBlockDim[0])));
163+
MaxBlockDim[0]));
164164

165165
roundToHighestFactorOfGlobalSizeIn3d(ThreadsPerBlock, GlobalSizeNormalized,
166166
MaxBlockDim, MaxBlockSize);
@@ -208,7 +208,7 @@ setKernelParams([[maybe_unused]] const ur_context_handle_t Context,
208208
MaxWorkGroupSize = Device->getMaxWorkGroupSize();
209209

210210
if (ProvidedLocalWorkGroupSize) {
211-
auto IsValid = [&](size_t Dim) {
211+
auto IsValid = [&](int Dim) {
212212
if (ReqdThreadsPerBlock[Dim] != 0 &&
213213
LocalWorkSize[Dim] != ReqdThreadsPerBlock[Dim])
214214
return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE;
@@ -217,8 +217,7 @@ setKernelParams([[maybe_unused]] const ur_context_handle_t Context,
217217
LocalWorkSize[Dim] > MaxThreadsPerBlock[Dim])
218218
return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE;
219219

220-
if (LocalWorkSize[Dim] >
221-
Device->getMaxWorkItemSizes(static_cast<int>(Dim)))
220+
if (LocalWorkSize[Dim] > Device->getMaxWorkItemSizes(Dim))
222221
return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE;
223222
// Checks that local work sizes are a divisor of the global work sizes
224223
// which includes that the local work sizes are neither larger than
@@ -482,13 +481,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
482481

483482
auto &ArgIndices = hKernel->getArgIndices();
484483
UR_CHECK_ERROR(cuLaunchKernel(
485-
CuFunc, static_cast<unsigned int>(BlocksPerGrid[0]),
486-
static_cast<unsigned int>(BlocksPerGrid[1]),
487-
static_cast<unsigned int>(BlocksPerGrid[2]),
488-
static_cast<unsigned int>(ThreadsPerBlock[0]),
489-
static_cast<unsigned int>(ThreadsPerBlock[1]),
490-
static_cast<unsigned int>(ThreadsPerBlock[2]), LocalSize, CuStream,
491-
const_cast<void **>(ArgIndices.data()), nullptr));
484+
CuFunc, BlocksPerGrid[0], BlocksPerGrid[1], BlocksPerGrid[2],
485+
ThreadsPerBlock[0], ThreadsPerBlock[1], ThreadsPerBlock[2], LocalSize,
486+
CuStream, const_cast<void **>(ArgIndices.data()), nullptr));
492487

493488
if (LocalSize != 0)
494489
hKernel->clearLocalSize();
@@ -654,12 +649,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp(
654649
auto &ArgIndices = hKernel->getArgIndices();
655650

656651
CUlaunchConfig launch_config;
657-
launch_config.gridDimX = static_cast<unsigned int>(BlocksPerGrid[0]);
658-
launch_config.gridDimY = static_cast<unsigned int>(BlocksPerGrid[1]);
659-
launch_config.gridDimZ = static_cast<unsigned int>(BlocksPerGrid[2]);
660-
launch_config.blockDimX = static_cast<unsigned int>(ThreadsPerBlock[0]);
661-
launch_config.blockDimY = static_cast<unsigned int>(ThreadsPerBlock[1]);
662-
launch_config.blockDimZ = static_cast<unsigned int>(ThreadsPerBlock[2]);
652+
launch_config.gridDimX = BlocksPerGrid[0];
653+
launch_config.gridDimY = BlocksPerGrid[1];
654+
launch_config.gridDimZ = BlocksPerGrid[2];
655+
launch_config.blockDimX = ThreadsPerBlock[0];
656+
launch_config.blockDimY = ThreadsPerBlock[1];
657+
launch_config.blockDimZ = ThreadsPerBlock[2];
663658

664659
launch_config.sharedMemBytes = LocalSize;
665660
launch_config.hStream = CuStream;
@@ -984,9 +979,8 @@ ur_result_t commonMemSetLargePattern(CUstream Stream, uint32_t PatternSize,
984979
auto OffsetPtr = Ptr + (step * sizeof(uint8_t));
985980

986981
// set all of the pattern chunks
987-
UR_CHECK_ERROR(cuMemsetD2D8Async(OffsetPtr, Pitch,
988-
static_cast<unsigned char>(Value),
989-
sizeof(uint8_t), Height, Stream));
982+
UR_CHECK_ERROR(cuMemsetD2D8Async(OffsetPtr, Pitch, Value, sizeof(uint8_t),
983+
Height, Stream));
990984
}
991985
return UR_RESULT_SUCCESS;
992986
}
@@ -1037,9 +1031,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferFill(
10371031
break;
10381032
}
10391033
default: {
1040-
UR_CHECK_ERROR(
1041-
commonMemSetLargePattern(Stream, static_cast<uint32_t>(patternSize),
1042-
size, pPattern, DstDevice));
1034+
UR_CHECK_ERROR(commonMemSetLargePattern(Stream, patternSize, size,
1035+
pPattern, DstDevice));
10431036
break;
10441037
}
10451038
}
@@ -1071,6 +1064,7 @@ static size_t imageElementByteSize(CUDA_ARRAY_DESCRIPTOR ArrayDesc) {
10711064
return 4;
10721065
default:
10731066
detail::ur::die("Invalid image format.");
1067+
return 0;
10741068
}
10751069
}
10761070

@@ -1174,7 +1168,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
11741168
CUDA_ARRAY_DESCRIPTOR ArrayDesc;
11751169
UR_CHECK_ERROR(cuArrayGetDescriptor(&ArrayDesc, Array));
11761170

1177-
int ElementByteSize = static_cast<int>(imageElementByteSize(ArrayDesc));
1171+
int ElementByteSize = imageElementByteSize(ArrayDesc);
11781172

11791173
size_t ByteOffsetX = origin.x * ElementByteSize * ArrayDesc.NumChannels;
11801174
size_t BytesToCopy = ElementByteSize * ArrayDesc.NumChannels * region.width;
@@ -1247,7 +1241,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite(
12471241
CUDA_ARRAY_DESCRIPTOR ArrayDesc;
12481242
UR_CHECK_ERROR(cuArrayGetDescriptor(&ArrayDesc, Array));
12491243

1250-
int ElementByteSize = static_cast<int>(imageElementByteSize(ArrayDesc));
1244+
int ElementByteSize = imageElementByteSize(ArrayDesc);
12511245

12521246
size_t ByteOffsetX = origin.x * ElementByteSize * ArrayDesc.NumChannels;
12531247
size_t BytesToCopy = ElementByteSize * ArrayDesc.NumChannels * region.width;
@@ -1326,7 +1320,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageCopy(
13261320
UR_ASSERT(SrcArrayDesc.NumChannels == DstArrayDesc.NumChannels,
13271321
UR_RESULT_ERROR_INVALID_MEM_OBJECT);
13281322

1329-
int ElementByteSize = static_cast<int>(imageElementByteSize(SrcArrayDesc));
1323+
int ElementByteSize = imageElementByteSize(SrcArrayDesc);
13301324

13311325
size_t DstByteOffsetX =
13321326
dstOrigin.x * ElementByteSize * SrcArrayDesc.NumChannels;
@@ -1511,8 +1505,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill(
15111505
CuStream));
15121506
break;
15131507
default:
1514-
commonMemSetLargePattern(CuStream, static_cast<uint32_t>(patternSize),
1515-
size, pPattern, (CUdeviceptr)ptr);
1508+
commonMemSetLargePattern(CuStream, patternSize, size, pPattern,
1509+
(CUdeviceptr)ptr);
15161510
break;
15171511
}
15181512
if (phEvent) {

source/adapters/cuda/image.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPitchedAllocExp(
284284
ur_result_t Result = UR_RESULT_SUCCESS;
285285
try {
286286
ScopedContext Active(hDevice);
287-
UR_CHECK_ERROR(
288-
cuMemAllocPitch((CUdeviceptr *)ppMem, pResultPitch, widthInBytes,
289-
height, static_cast<unsigned int>(elementSizeBytes)));
287+
UR_CHECK_ERROR(cuMemAllocPitch((CUdeviceptr *)ppMem, pResultPitch,
288+
widthInBytes, height, elementSizeBytes));
290289
} catch (ur_result_t error) {
291290
Result = error;
292291
} catch (...) {

source/adapters/cuda/kernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp(
203203

204204
int MaxNumActiveGroupsPerCU{0};
205205
UR_CHECK_ERROR(cuOccupancyMaxActiveBlocksPerMultiprocessor(
206-
&MaxNumActiveGroupsPerCU, hKernel->get(),
207-
static_cast<int>(localWorkSize), dynamicSharedMemorySize));
206+
&MaxNumActiveGroupsPerCU, hKernel->get(), localWorkSize,
207+
dynamicSharedMemorySize));
208208
detail::ur::assertion(MaxNumActiveGroupsPerCU >= 0);
209209
// Handle the case where we can't have all SMs active with at least 1 group
210210
// per SM. In that case, the device is still able to run 1 work-group, hence

source/adapters/cuda/kernel.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ struct ur_kernel_handle_t_ {
9797
}
9898
ParamSizes[Index] = Size;
9999
// calculate the insertion point on the array
100-
size_t InsertPos = std::accumulate(
101-
std::begin(ParamSizes), std::begin(ParamSizes) + Index, size_t{0});
100+
size_t InsertPos = std::accumulate(std::begin(ParamSizes),
101+
std::begin(ParamSizes) + Index, 0);
102102
// Update the stored value for the argument
103103
std::memcpy(&Storage[InsertPos], Arg, Size);
104104
Indices[Index] = &Storage[InsertPos];
@@ -152,8 +152,8 @@ struct ur_kernel_handle_t_ {
152152
const args_index_t &getIndices() const noexcept { return Indices; }
153153

154154
uint32_t getLocalSize() const {
155-
return static_cast<uint32_t>(std::accumulate(
156-
std::begin(OffsetPerIndex), std::end(OffsetPerIndex), size_t{0}));
155+
return std::accumulate(std::begin(OffsetPerIndex),
156+
std::end(OffsetPerIndex), 0);
157157
}
158158
} Args;
159159

source/adapters/cuda/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ ur_result_t ur_program_handle_t_::buildProgram(const char *BuildOptions) {
148148
}
149149

150150
UR_CHECK_ERROR(cuModuleLoadDataEx(&Module, static_cast<const void *>(Binary),
151-
static_cast<unsigned int>(Options.size()),
152-
Options.data(), OptionVals.data()));
151+
Options.size(), Options.data(),
152+
OptionVals.data()));
153153

154154
BuildStatus = UR_PROGRAM_BUILD_STATUS_SUCCESS;
155155

source/adapters/cuda/usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ umf_result_t USMMemoryProvider::initialize(ur_context_handle_t Ctx,
325325

326326
enum umf_result_t USMMemoryProvider::alloc(size_t Size, size_t Align,
327327
void **Ptr) {
328-
auto Res = allocateImpl(Ptr, Size, static_cast<uint32_t>(Align));
328+
auto Res = allocateImpl(Ptr, Size, Align);
329329
if (Res != UR_RESULT_SUCCESS) {
330330
getLastStatusRef() = Res;
331331
return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC;

source/adapters/level_zero/CMakeLists.txt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,18 @@ if(UR_BUILD_ADAPTER_L0)
8989
endif()
9090

9191
# TODO: fix level_zero adapter conversion warnings
92-
# C4267: The compiler detected a conversion from size_t to a smaller type.
9392
target_compile_options(ur_adapter_level_zero PRIVATE
94-
$<$<CXX_COMPILER_ID:MSVC>:/wd4805 /wd4244 /wd4267>
93+
$<$<CXX_COMPILER_ID:MSVC>:/wd4805 /wd4244>
9594
)
9695

9796
set_target_properties(ur_adapter_level_zero PROPERTIES
9897
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
9998
SOVERSION "${PROJECT_VERSION_MAJOR}"
10099
)
101100

102-
if(CMAKE_CXX_COMPILER_LINKER_ID MATCHES MSVC)
103-
# 0x800: Search for the DLL only in the System32 folder
104-
target_link_options(ur_adapter_level_zero PRIVATE LINKER:/DEPENDENTLOADFLAG:0x800)
101+
if (WIN32)
102+
# 0x800: Search for the DLL only in the System32 folder
103+
target_link_options(ur_adapter_level_zero PRIVATE /DEPENDENTLOADFLAG:0x800)
105104
endif()
106105

107106
target_link_libraries(ur_adapter_level_zero PRIVATE
@@ -184,19 +183,18 @@ if(UR_BUILD_ADAPTER_L0_V2)
184183
target_compile_definitions(ur_adapter_level_zero_v2 PUBLIC UR_ADAPTER_LEVEL_ZERO_V2)
185184

186185
# TODO: fix level_zero adapter conversion warnings
187-
# C4267: The compiler detected a conversion from size_t to a smaller type.
188186
target_compile_options(ur_adapter_level_zero_v2 PRIVATE
189-
$<$<CXX_COMPILER_ID:MSVC>:/wd4805 /wd4244 /wd4100 /wd4267>
187+
$<$<CXX_COMPILER_ID:MSVC>:/wd4805 /wd4244>
190188
)
191189

192190
set_target_properties(ur_adapter_level_zero_v2 PROPERTIES
193191
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
194192
SOVERSION "${PROJECT_VERSION_MAJOR}"
195193
)
196194

197-
if(CMAKE_CXX_COMPILER_LINKER_ID MATCHES MSVC)
198-
# 0x800: Search for the DLL only in the System32 folder
199-
target_link_options(ur_adapter_level_zero_v2 PUBLIC LINKER:/DEPENDENTLOADFLAG:0x800)
195+
if (WIN32)
196+
# 0x800: Search for the DLL only in the System32 folder
197+
target_link_options(ur_adapter_level_zero_v2 PUBLIC /DEPENDENTLOADFLAG:0x800)
200198
endif()
201199

202200
target_link_libraries(ur_adapter_level_zero_v2 PRIVATE

0 commit comments

Comments
 (0)