Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy and move common adapter code to ur_common #997

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions source/adapters/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ add_ur_adapter(${TARGET_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/usm.cpp
${CMAKE_CURRENT_SOURCE_DIR}/usm_p2p.cpp
${CMAKE_CURRENT_SOURCE_DIR}/virtual_mem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp
)

set_target_properties(${TARGET_NAME} PROPERTIES
Expand Down Expand Up @@ -83,7 +81,3 @@ target_link_libraries(${TARGET_NAME} PRIVATE
Threads::Threads
cudadrv
)

target_include_directories(${TARGET_NAME} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../../"
)
2 changes: 1 addition & 1 deletion source/adapters/cuda/adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urAdapterGetInfo(ur_adapter_handle_t,
size_t propSize,
void *pPropValue,
size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

switch (propName) {
case UR_ADAPTER_INFO_BACKEND:
Expand Down
1 change: 0 additions & 1 deletion source/adapters/cuda/command_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
//
//===----------------------------------------------------------------------===//

#include <ur/ur.hpp>
#include <ur_api.h>

#include "context.hpp"
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#pragma once

#include <cuda.h>
#include <ur/ur.hpp>
#include <ur_util.hpp>

ur_result_t mapErrorUR(CUresult Result);

Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ urContextCreate(uint32_t DeviceCount, const ur_device_handle_t *phDevices,
UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo(
ur_context_handle_t hContext, ur_context_info_t ContextInfoType,
size_t propSize, void *pContextInfo, size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pContextInfo, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pContextInfo, pPropSizeRet);

switch (static_cast<uint32_t>(ContextInfoType)) {
case UR_CONTEXT_INFO_NUM_DEVICES:
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
size_t propSize,
void *pPropValue,
size_t *pPropSizeRet) try {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

static constexpr uint32_t MaxWorkItemDimensions = 3u;

Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//===----------------------------------------------------------------------===//
#pragma once

#include <ur/ur.hpp>
#include <ur_api.h>

#include "common.hpp"

Expand Down
4 changes: 2 additions & 2 deletions source/adapters/cuda/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent,
size_t propValueSize,
void *pPropValue,
size_t *pPropValueSizeRet) {
UrReturnHelper ReturnValue(propValueSize, pPropValue, pPropValueSizeRet);
ur::ReturnHelper ReturnValue(propValueSize, pPropValue, pPropValueSizeRet);

switch (propName) {
case UR_EVENT_INFO_COMMAND_QUEUE:
Expand All @@ -187,7 +187,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent,
UR_APIEXPORT ur_result_t UR_APICALL urEventGetProfilingInfo(
ur_event_handle_t hEvent, ur_profiling_info_t propName,
size_t propValueSize, void *pPropValue, size_t *pPropValueSizeRet) {
UrReturnHelper ReturnValue(propValueSize, pPropValue, pPropValueSizeRet);
ur::ReturnHelper ReturnValue(propValueSize, pPropValue, pPropValueSizeRet);

ur_queue_handle_t Queue = hEvent->getQueue();
if (Queue == nullptr || !(Queue->URFlags & UR_QUEUE_FLAG_PROFILING_ENABLE)) {
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#pragma once

#include <cuda.h>
#include <ur/ur.hpp>
#include <ur_api.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a distinction between the #include <ur_api.h> (h-char-sequence) and #include "ur_api.h" (q-char-sequence). Though the c99 standard (and by reference c++11 - c++20) leave latitude for interpretation of these two forms, it's standard practise to use the "q" form for internal includes and the "h" form for system includes (see e.g. llvm).

Since ur_api.h is part of the present project, I believe all instances should the quoted form. Such a general cleanup certainly belongs in a separate patch, but for all changes introduced changes here, I think it makes sense to use q-char uniformly


#include "common.hpp"
#include "queue.hpp"
Expand Down
1 change: 0 additions & 1 deletion source/adapters/cuda/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "memory.hpp"
#include "queue.hpp"
#include "sampler.hpp"
#include "ur/ur.hpp"
#include "ur_api.h"

ur_result_t urCalculateNumChannels(ur_image_channel_order_t order,
Expand Down
6 changes: 3 additions & 3 deletions source/adapters/cuda/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
urKernelGetGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice,
ur_kernel_group_info_t propName, size_t propSize,
void *pPropValue, size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

switch (propName) {
case UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE: {
Expand Down Expand Up @@ -205,7 +205,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetInfo(ur_kernel_handle_t hKernel,
size_t propSize,
void *pKernelInfo,
size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pKernelInfo, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pKernelInfo, pPropSizeRet);

switch (propName) {
case UR_KERNEL_INFO_FUNCTION_NAME:
Expand Down Expand Up @@ -237,7 +237,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
urKernelGetSubGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice,
ur_kernel_sub_group_info_t propName, size_t propSize,
void *pPropValue, size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
switch (propName) {
case UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE: {
// Sub-group size is equivalent to warp size
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
size_t *pPropSizeRet) {
UR_ASSERT(hMemory->isBuffer(), UR_RESULT_ERROR_INVALID_MEM_OBJECT);

UrReturnHelper ReturnValue(propSize, pMemInfo, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pMemInfo, pPropSizeRet);

ScopedContext Active(hMemory->getContext());

Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/physical_mem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//===----------------------------------------------------------------------===//
#pragma once

#include <ur/ur.hpp>
#include <ur_api.h>

#include <cuda.h>

Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetInfo(
size_t Size, void *pPlatformInfo, size_t *pSizeRet) {

UR_ASSERT(hPlatform, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
UrReturnHelper ReturnValue(Size, pPlatformInfo, pSizeRet);
ur::ReturnHelper ReturnValue(Size, pPlatformInfo, pSizeRet);

switch (PlatformInfoType) {
case UR_PLATFORM_INFO_NAME:
Expand Down
4 changes: 3 additions & 1 deletion source/adapters/cuda/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
//===----------------------------------------------------------------------===//
#pragma once

#include <ur/ur.hpp>

#include "ur_api.h"
#include <memory>
#include <vector>

struct ur_platform_handle_t_ {
Expand Down
4 changes: 2 additions & 2 deletions source/adapters/cuda/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ urProgramGetBuildInfo(ur_program_handle_t hProgram, ur_device_handle_t hDevice,
void *pPropValue, size_t *pPropSizeRet) {
std::ignore = hDevice;

UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

switch (propName) {
case UR_PROGRAM_BUILD_INFO_STATUS: {
Expand All @@ -361,7 +361,7 @@ urProgramGetBuildInfo(ur_program_handle_t hProgram, ur_device_handle_t hDevice,
UR_APIEXPORT ur_result_t UR_APICALL
urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
size_t propSize, void *pProgramInfo, size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pProgramInfo, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pProgramInfo, pPropSizeRet);

switch (propName) {
case UR_PROGRAM_INFO_REFERENCE_COUNT:
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueGetInfo(ur_queue_handle_t hQueue,
size_t propValueSize,
void *pPropValue,
size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propValueSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propValueSize, pPropValue, pPropSizeRet);

switch (propName) {
case UR_QUEUE_INFO_CONTEXT:
Expand Down
4 changes: 3 additions & 1 deletion source/adapters/cuda/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
//===----------------------------------------------------------------------===//
#pragma once

#include <ur/ur.hpp>
#include <ur_api.h>

#include <algorithm>
#include <atomic>
#include <cuda.h>
#include <mutex>
#include <vector>

using ur_stream_guard_ = std::unique_lock<std::mutex>;
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/sampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ urSamplerCreate(ur_context_handle_t hContext, const ur_sampler_desc_t *pDesc,
UR_APIEXPORT ur_result_t UR_APICALL
urSamplerGetInfo(ur_sampler_handle_t hSampler, ur_sampler_info_t propName,
size_t propValueSize, void *pPropValue, size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propValueSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propValueSize, pPropValue, pPropSizeRet);

switch (propName) {
case UR_SAMPLER_INFO_REFERENCE_COUNT:
Expand Down
4 changes: 3 additions & 1 deletion source/adapters/cuda/sampler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
//
//===----------------------------------------------------------------------===//

#include <ur/ur.hpp>
#include <ur_api.h>

#include <atomic>

/// Implementation of samplers for CUDA
///
Expand Down
4 changes: 2 additions & 2 deletions source/adapters/cuda/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ urUSMGetMemAllocInfo(ur_context_handle_t hContext, const void *pMem,
void *pPropValue, size_t *pPropValueSizeRet) {
ur_result_t Result = UR_RESULT_SUCCESS;

UrReturnHelper ReturnValue(propValueSize, pPropValue, pPropValueSizeRet);
ur::ReturnHelper ReturnValue(propValueSize, pPropValue, pPropValueSizeRet);

try {
ScopedContext Active(hContext);
Expand Down Expand Up @@ -486,7 +486,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetInfo(
size_t *pPropSizeRet ///< [out][optional] size in bytes returned in pool
///< property value
) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

switch (propName) {
case UR_USM_POOL_INFO_REFERENCE_COUNT: {
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/usm_p2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp(
ur_exp_peer_info_t propName, size_t propSize, void *pPropValue,
size_t *pPropSizeRet) {

UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

int value;
CUdevice_P2PAttribute cu_attr;
Expand Down
4 changes: 2 additions & 2 deletions source/adapters/cuda/virtual_mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urVirtualMemGranularityGetInfo(
ur_context_handle_t hContext, ur_device_handle_t hDevice,
ur_virtual_mem_granularity_info_t propName, size_t propSize,
void *pPropValue, size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

ScopedContext Active(hContext);
switch (propName) {
Expand Down Expand Up @@ -108,7 +108,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urVirtualMemGetInfo(
ur_context_handle_t hContext, const void *pStart,
[[maybe_unused]] size_t size, ur_virtual_mem_info_t propName,
size_t propSize, void *pPropValue, size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

ScopedContext Active(hContext);
switch (propName) {
Expand Down
6 changes: 0 additions & 6 deletions source/adapters/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ add_ur_adapter(${TARGET_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/usm.cpp
${CMAKE_CURRENT_SOURCE_DIR}/usm_p2p.cpp
${CMAKE_CURRENT_SOURCE_DIR}/virtual_mem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp
)

if(NOT MSVC)
Expand Down Expand Up @@ -184,7 +182,3 @@ elseif("${UR_HIP_PLATFORM}" STREQUAL "NVIDIA")
else()
message(FATAL_ERROR "Unspecified UR HIP platform please set UR_HIP_PLATFORM to 'AMD' or 'NVIDIA'")
endif()

target_include_directories(${TARGET_NAME} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../../"
)
2 changes: 1 addition & 1 deletion source/adapters/hip/adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urAdapterGetInfo(ur_adapter_handle_t,
size_t propSize,
void *pPropValue,
size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

switch (propName) {
case UR_ADAPTER_INFO_BACKEND:
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/hip/command_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
//===----------------------------------------------------------------------===//

#include <ur/ur.hpp>
#include <ur_api.h>

/// Stub implementation of command-buffers for HIP

Expand Down
3 changes: 2 additions & 1 deletion source/adapters/hip/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#endif
#endif
#include <hip/hip_runtime.h>
#include <ur/ur.hpp>
#include <ur_api.h>
#include <ur_util.hpp>

// Before ROCm 6, hipify doesn't support cuArrayGetDescriptor, on AMD the
// hipArray can just be indexed, but on NVidia it is an opaque type and needs to
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/hip/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName,
size_t propSize, void *pPropValue, size_t *pPropSizeRet) {

UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

switch (uint32_t{propName}) {
case UR_CONTEXT_INFO_NUM_DEVICES:
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/hip/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
size_t propSize,
void *pPropValue,
size_t *pPropSizeRet) {
UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);
ur::ReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet);

static constexpr uint32_t MaxWorkItemDimensions = 3u;

Expand Down
2 changes: 1 addition & 1 deletion source/adapters/hip/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "common.hpp"

#include <ur/ur.hpp>
#include <ur_api.h>

/// UR device mapping to a hipDevice_t.
/// Includes an observer pointer to the platform,
Expand Down
12 changes: 6 additions & 6 deletions source/adapters/hip/enqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferRead(

std::unique_ptr<ur_event_handle_t_> RetImplEvent{nullptr};

ur_lock MemoryMigrationLock{hBuffer->MemoryMigrationMutex};
ur::Lock MemoryMigrationLock{hBuffer->MemoryMigrationMutex};
auto Device = hQueue->getDevice();
hipStream_t HIPStream = hQueue->getNextTransferStream();

Expand Down Expand Up @@ -254,7 +254,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(

std::vector<ur_event_handle_t> DepEvents(
phEventWaitList, phEventWaitList + numEventsInWaitList);
std::vector<std::pair<ur_mem_handle_t, ur_lock>> MemMigrationLocks;
std::vector<std::pair<ur_mem_handle_t, ur::Lock>> MemMigrationLocks;

// phEventWaitList only contains events that are handed to UR by the SYCL
// runtime. However since UR handles memory dependencies within a context
Expand All @@ -277,8 +277,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
[MemArg](auto &Lock) {
return Lock.first == MemArg.Mem;
}) == MemMigrationLocks.end())
MemMigrationLocks.emplace_back(
std::pair{MemArg.Mem, ur_lock{MemArg.Mem->MemoryMigrationMutex}});
MemMigrationLocks.emplace_back(std::pair{
MemArg.Mem, ur::Lock{MemArg.Mem->MemoryMigrationMutex}});
}
}
}
Expand Down Expand Up @@ -632,7 +632,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
std::unique_ptr<ur_event_handle_t_> RetImplEvent{nullptr};

ur_result_t Result = UR_RESULT_SUCCESS;
ur_lock MemoryMigrationLock(hBuffer->MemoryMigrationMutex);
ur::Lock MemoryMigrationLock(hBuffer->MemoryMigrationMutex);
auto Device = hQueue->getDevice();
hipStream_t HIPStream = hQueue->getNextTransferStream();

Expand Down Expand Up @@ -1026,7 +1026,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
UR_ASSERT(hImage->isImage(), UR_RESULT_ERROR_INVALID_MEM_OBJECT);

ur_lock MemoryMigrationLock{hImage->MemoryMigrationMutex};
ur::Lock MemoryMigrationLock{hImage->MemoryMigrationMutex};
auto Device = hQueue->getDevice();
hipStream_t HIPStream = hQueue->getNextTransferStream();

Expand Down
Loading
Loading