Skip to content
Merged
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
14 changes: 14 additions & 0 deletions unified-runtime/include/ur_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions unified-runtime/scripts/core/kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ params:
desc: "[in] handle of Sampler object."
returns:
- $X_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "Device `$X_DEVICE_INFO_IMAGE_SUPPORT` is false"
--- #--------------------------------------------------------------------------
type: struct
desc: "Properties for for $xKernelSetArgMemObj."
Expand Down
4 changes: 4 additions & 0 deletions unified-runtime/scripts/core/memory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ returns:
- "`pImageDesc && pImageDesc->numSamples != 0`"
- "`pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`"
- "`pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`"
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "Device `$X_DEVICE_INFO_IMAGE_SUPPORT` is false"
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
- $X_RESULT_ERROR_INVALID_OPERATION
- $X_RESULT_ERROR_INVALID_HOST_PTR:
Expand Down Expand Up @@ -627,6 +629,8 @@ returns:
- $X_RESULT_ERROR_INVALID_NULL_POINTER:
- "`propSize != 0 && pPropValue == NULL`"
- "`pPropValue == NULL && pPropSizeRet == NULL`"
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "Device `$X_DEVICE_INFO_IMAGE_SUPPORT` is false"
- $X_RESULT_ERROR_INVALID_MEM_OBJECT
- $X_RESULT_ERROR_OUT_OF_RESOURCES
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
8 changes: 8 additions & 0 deletions unified-runtime/scripts/core/sampler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ returns:
- $X_RESULT_ERROR_INVALID_OPERATION
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
- $X_RESULT_ERROR_OUT_OF_RESOURCES
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "Device `$X_DEVICE_INFO_IMAGE_SUPPORT` is false"
--- #--------------------------------------------------------------------------
type: function
desc: "Get a reference to the sampler object handle. Increment its reference count"
Expand All @@ -121,6 +123,8 @@ returns:
- $X_RESULT_ERROR_INVALID_SAMPLER
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
- $X_RESULT_ERROR_OUT_OF_RESOURCES
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "Device `$X_DEVICE_INFO_IMAGE_SUPPORT` is false"
--- #--------------------------------------------------------------------------
type: function
desc: "Decrement the sampler's reference count and delete the sampler if the reference count becomes zero."
Expand All @@ -137,6 +141,8 @@ returns:
- $X_RESULT_ERROR_INVALID_SAMPLER
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
- $X_RESULT_ERROR_OUT_OF_RESOURCES
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "Device `$X_DEVICE_INFO_IMAGE_SUPPORT` is false"
--- #--------------------------------------------------------------------------
type: function
desc: "Query information about a sampler object"
Expand Down Expand Up @@ -173,6 +179,8 @@ returns:
- $X_RESULT_ERROR_INVALID_SAMPLER
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
- $X_RESULT_ERROR_OUT_OF_RESOURCES
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
- "Device `$X_DEVICE_INFO_IMAGE_SUPPORT` is false"
--- #--------------------------------------------------------------------------
type: function
desc: "Return sampler native sampler handle."
Expand Down
1 change: 1 addition & 0 deletions unified-runtime/source/adapters/offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_ur_adapter(${TARGET_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/platform.cpp
${CMAKE_CURRENT_SOURCE_DIR}/program.cpp
${CMAKE_CURRENT_SOURCE_DIR}/queue.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sampler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ur2offload.hpp
${CMAKE_CURRENT_SOURCE_DIR}/ur_interface_loader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/usm.cpp
Expand Down
6 changes: 6 additions & 0 deletions unified-runtime/source/adapters/offload/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize(
const size_t *, size_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgSampler(
ur_kernel_handle_t, uint32_t, const ur_kernel_arg_sampler_properties_t *,
ur_sampler_handle_t) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
19 changes: 19 additions & 0 deletions unified-runtime/source/adapters/offload/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemBufferPartition(

return urMemRetain(hBuffer);
}

UR_APIEXPORT ur_result_t UR_APICALL
urMemImageCreate(ur_context_handle_t, ur_mem_flags_t, const ur_image_format_t *,
const ur_image_desc_t *, void *, ur_mem_handle_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreateWithNativeHandle(
ur_native_handle_t, ur_context_handle_t, const ur_image_format_t *,
const ur_image_desc_t *, const ur_mem_native_properties_t *,
ur_mem_handle_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t,
ur_image_info_t, size_t,
void *, size_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
52 changes: 52 additions & 0 deletions unified-runtime/source/adapters/offload/sampler.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//===--------- sampler.cpp - LLVM Offload Adapter -------------------------===//
//
// Copyright (C) 2023 Intel Corporation
//
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
// Exceptions. See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "ur_api.h"

UR_APIEXPORT ur_result_t UR_APICALL urSamplerCreate(
ur_context_handle_t /*hContext*/, const ur_sampler_desc_t * /*pDesc*/,
ur_sampler_handle_t * /*phSampler*/) {

return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL
urSamplerRetain(ur_sampler_handle_t /*hSampler*/) {

return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL
urSamplerRelease(ur_sampler_handle_t /*hSampler*/) {

return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urSamplerGetInfo(
ur_sampler_handle_t /*hSampler*/, ur_sampler_info_t /*propName*/,
size_t /*propSize*/, void * /*pPropValue*/, size_t * /*pPropSizeRet*/) {

return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL
urSamplerGetNativeHandle(ur_sampler_handle_t /*hSampler*/,
ur_native_handle_t * /*phNativeSampler*/) {

return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
ur_native_handle_t /*hNativeSampler*/, ur_context_handle_t /*hContext*/,
const ur_sampler_native_properties_t * /*pProperties*/,
ur_sampler_handle_t * /*phSampler*/) {

return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
20 changes: 10 additions & 10 deletions unified-runtime/source/adapters/offload/ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelProcAddrTable(
pDdiTable->pfnSetArgLocal = nullptr;
pDdiTable->pfnSetArgMemObj = urKernelSetArgMemObj;
pDdiTable->pfnSetArgPointer = urKernelSetArgPointer;
pDdiTable->pfnSetArgSampler = nullptr;
pDdiTable->pfnSetArgSampler = urKernelSetArgSampler;
pDdiTable->pfnSetArgValue = urKernelSetArgValue;
pDdiTable->pfnSetExecInfo = urKernelSetExecInfo;
pDdiTable->pfnSetSpecializationConstants = urKernelSetSpecializationConstants;
Expand All @@ -134,12 +134,12 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetSamplerProcAddrTable(
if (UR_RESULT_SUCCESS != result) {
return result;
}
pDdiTable->pfnCreate = nullptr;
pDdiTable->pfnCreateWithNativeHandle = nullptr;
pDdiTable->pfnGetInfo = nullptr;
pDdiTable->pfnGetNativeHandle = nullptr;
pDdiTable->pfnRelease = nullptr;
pDdiTable->pfnRetain = nullptr;
pDdiTable->pfnCreate = urSamplerCreate;
pDdiTable->pfnCreateWithNativeHandle = urSamplerCreateWithNativeHandle;
pDdiTable->pfnGetInfo = urSamplerGetInfo;
pDdiTable->pfnGetNativeHandle = urSamplerGetNativeHandle;
pDdiTable->pfnRelease = urSamplerRelease;
pDdiTable->pfnRetain = urSamplerRetain;
return UR_RESULT_SUCCESS;
}

Expand All @@ -152,11 +152,11 @@ urGetMemProcAddrTable(ur_api_version_t version, ur_mem_dditable_t *pDdiTable) {
pDdiTable->pfnBufferCreate = urMemBufferCreate;
pDdiTable->pfnBufferPartition = urMemBufferPartition;
pDdiTable->pfnBufferCreateWithNativeHandle = nullptr;
pDdiTable->pfnImageCreateWithNativeHandle = nullptr;
pDdiTable->pfnImageCreateWithNativeHandle = urMemImageCreateWithNativeHandle;
pDdiTable->pfnGetInfo = urMemGetInfo;
pDdiTable->pfnGetNativeHandle = nullptr;
pDdiTable->pfnImageCreate = nullptr;
pDdiTable->pfnImageGetInfo = nullptr;
pDdiTable->pfnImageCreate = urMemImageCreate;
pDdiTable->pfnImageGetInfo = urMemImageGetInfo;
pDdiTable->pfnRelease = urMemRelease;
pDdiTable->pfnRetain = urMemRetain;
return UR_RESULT_SUCCESS;
Expand Down
14 changes: 14 additions & 0 deletions unified-runtime/source/loader/ur_libapi.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions unified-runtime/source/ur_api.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading