Skip to content

Commit 592e0d0

Browse files
author
Jaime Arteaga
committed
Fix casting for srgba-read.cpp test
pi_bool is uint32_t and ur_bool_t is uint8_t, so to make sure correct functionality is maintain, use uint32_t as replacement for pi_bool, instead of ur_bool_t. Also, add back check for urMemImageCreate that was before in piMemImageCreate. Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
1 parent 3679ee2 commit 592e0d0

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_context.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#include "ur_level_zero.hpp"
1515
#include "ur_level_zero_context.hpp"
16-
#include "ur_level_zero.hpp"
17-
1816

1917
UR_APIEXPORT ur_result_t UR_APICALL urContextCreate(
2018
uint32_t DeviceCount, ///< [in] the number of devices given in phDevices
@@ -108,10 +106,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo(
108106
return ReturnValue(uint32_t{Context->RefCount.load()});
109107
case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT:
110108
// 2D USM memcpy is supported.
111-
return ReturnValue(ur_bool_t{UseMemcpy2DOperations});
109+
return ReturnValue(uint32_t{UseMemcpy2DOperations});
112110
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT:
113111
// 2D USM fill is not supported.
114-
return ReturnValue(ur_bool_t{false});
112+
return ReturnValue(uint32_t{false});
115113
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: {
116114

117115
ur_memory_order_capability_flags_t Capabilities =

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "ur_level_zero.hpp"
1111
#include <algorithm>
1212
#include <climits>
13-
1413

1514
UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(
1615
ur_platform_handle_t Platform, ///< [in] handle of the platform instance
@@ -771,9 +770,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
771770
return ReturnValue(capabilities);
772771
}
773772
case UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT:
774-
return ReturnValue(ur_bool_t{false});
773+
return ReturnValue(uint32_t{false});
775774
case UR_DEVICE_INFO_IMAGE_SRGB:
776-
return ReturnValue(ur_bool_t{false});
775+
return ReturnValue(uint32_t{false});
777776

778777
case UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES:
779778
case UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: {
@@ -1197,7 +1196,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceSelectBinary(
11971196

11981197
// Look for GEN binary, which we known can only be handled by Level-Zero now.
11991198
const char *BinaryTarget =
1200-
UR_DEVICE_BINARY_TARGET_SPIRV64_GEN; //UR_DEVICE_BINARY_TARGET_SPIRV64_GEN;
1199+
UR_DEVICE_BINARY_TARGET_SPIRV64_GEN; // UR_DEVICE_BINARY_TARGET_SPIRV64_GEN;
12011200

12021201
uint32_t *SelectedBinaryInd = SelectedBinary;
12031202

sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_mem.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include "ur_level_zero.hpp"
1414
#include "ur_level_zero_context.hpp"
1515
#include "ur_level_zero_event.hpp"
16-
#include "ur_level_zero.hpp"
17-
1816

1917
// Default to using compute engine for fill operation, but allow to
2018
// override this with an environment variable.
@@ -1604,6 +1602,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
16041602
void *Host, ///< [in] pointer to the buffer data
16051603
ur_mem_handle_t *Mem ///< [out] pointer to handle of image object created
16061604
) {
1605+
// TODO: implement read-only, write-only
1606+
if ((Flags & UR_MEM_FLAG_READ_WRITE) == 0) {
1607+
die("urMemImageCreate: Level-Zero implements only read-write buffer,"
1608+
"no read-only or write-only yet.");
1609+
}
1610+
16071611
std::shared_lock<ur_shared_mutex> Lock(Context->Mutex);
16081612

16091613
ZeStruct<ze_image_desc_t> ZeImageDesc;

0 commit comments

Comments
 (0)