Skip to content

Commit 95837b0

Browse files
committed
Fix windows build.
1 parent 5c36ea6 commit 95837b0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

source/adapters/mock/ur_mock.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ur_result_t mock_urPlatformGetInfo(void *pParams) {
3636
if (*params.ppPropValue) {
3737
#if defined(_WIN32)
3838
strncpy_s(reinterpret_cast<char *>(*params.ppPropValue),
39-
*params.ppropSize, null_platform_name,
39+
*params.ppropSize, mock_platform_name,
4040
sizeof(mock_platform_name));
4141
#else
4242
strncpy(reinterpret_cast<char *>(*params.ppPropValue),

test/fuzz/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function(add_fuzz_test name label)
2828
DisableDeepBind=1)
2929
endif()
3030
else()
31-
list(APPEND ENV_VARS UR_ADAPTERS_FORCE_LOAD=\"$<TARGET_FILE:ur_adapter_null>\")
31+
list(APPEND ENV_VARS UR_ADAPTERS_FORCE_LOAD=\"$<TARGET_FILE:ur_adapter_mock>\")
3232
endif()
3333

3434
add_test(NAME ${TEST_TARGET_NAME}

test/layers/validation/fixtures.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ inline ur_result_t genericSuccessCallback(void *) { return UR_RESULT_SUCCESS; };
134134
inline ur_result_t fakeContext_urContextCreate(void *pParams) {
135135
static std::atomic_int handle = 42;
136136
auto params = *static_cast<ur_context_create_params_t *>(pParams);
137-
**params.pphContext = reinterpret_cast<ur_context_handle_t>(handle++);
137+
// There are two casts because windows doesn't implicitly extend the 32 bit
138+
// result of atomic_int::operator++.
139+
**params.pphContext =
140+
reinterpret_cast<ur_context_handle_t>(static_cast<uintptr_t>(handle++));
138141
return UR_RESULT_SUCCESS;
139142
}
140143

0 commit comments

Comments
 (0)