Skip to content

Commit f2ca7a9

Browse files
committed
Merge branch 'adapters' into merge-some-main-changes-into-adapters-third-patch
2 parents a92a989 + a99d1db commit f2ca7a9

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/cmake.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ jobs:
283283
{name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
284284
]
285285

286-
# TODO: building level zero loader on windows-2019 is currently broken
286+
# TODO: building level zero loader on windows-2019 and clang-cl is currently broken
287287
exclude:
288288
- os: 'windows-2019'
289289
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
290+
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
291+
compiler: {c: clang-cl, cxx: clang-cl}
292+
290293
build_type: [Debug, Release]
291294
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
292295
include:

source/adapters/hip/memory.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
273273
UR_CHECK_ERROR(hipMemGetAddressRange(&BasePtr, &AllocSize, Mem.Ptr));
274274
return AllocSize;
275275
} else if constexpr (std::is_same_v<T, SurfaceMem>) {
276+
#if HIP_VERSION < 50600000
277+
throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
278+
#else
276279
HIP_ARRAY3D_DESCRIPTOR ArrayDescriptor;
277-
UR_CHECK_ERROR(hipArray3DGetDescriptor(&ArrayDescriptor, Mem.Array));
280+
UR_CHECK_ERROR(
281+
hipArray3DGetDescriptor(&ArrayDescriptor, Mem.getArray()));
278282
const auto PixelSizeBytes =
279283
GetHipFormatPixelSize(ArrayDescriptor.Format) *
280284
ArrayDescriptor.NumChannels;
@@ -284,6 +288,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
284288
(ArrayDescriptor.Height ? ArrayDescriptor.Height : 1) *
285289
(ArrayDescriptor.Depth ? ArrayDescriptor.Depth : 1);
286290
return ImageSizeBytes;
291+
#endif
287292
} else {
288293
static_assert(ur_always_false_t<T>, "Not exhaustive visitor!");
289294
}
@@ -535,10 +540,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory,
535540
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
536541

537542
try {
538-
539543
HIP_ARRAY3D_DESCRIPTOR ArrayInfo;
544+
#if HIP_VERSION >= 50600000
540545
UR_CHECK_ERROR(hipArray3DGetDescriptor(
541-
&ArrayInfo, std::get<SurfaceMem>(hMemory->Mem).Array));
546+
&ArrayInfo, std::get<SurfaceMem>(hMemory->Mem).getArray()));
547+
#else
548+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
549+
#endif
542550

543551
const auto hip2urFormat =
544552
[](hipArray_Format HipFormat) -> ur_image_channel_type_t {

0 commit comments

Comments
 (0)