Skip to content

[UR][BINDLESS] Fix UB in pitch alloc #18781

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

Draft
wants to merge 2 commits into
base: sycl
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 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: 1 addition & 1 deletion unified-runtime/include/ur_ddi.h

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

2 changes: 1 addition & 1 deletion unified-runtime/scripts/core/exp-bindless-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ params:
- type: "size_t"
name: elementSizeBytes
desc: "[in] size in bytes of an element in the allocation"
- type: void**
- type: void*
name: ppMem
desc: "[out] pointer to USM shared memory object"
- type: size_t*
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/cuda/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ ur_result_t urTextureCreate(const ur_sampler_desc_t *pSamplerDesc,
UR_APIEXPORT ur_result_t UR_APICALL urUSMPitchedAllocExp(
ur_context_handle_t hContext, ur_device_handle_t hDevice,
const ur_usm_desc_t * /*pUSMDesc*/, ur_usm_pool_handle_t /*pool*/,
size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem,
size_t widthInBytes, size_t height, size_t elementSizeBytes, void *ppMem,
size_t *pResultPitch) {
UR_ASSERT(std::find(hContext->getDevices().begin(),
hContext->getDevices().end(),
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/hip/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ ur_result_t urTextureCreate(const ur_sampler_desc_t *pSamplerDesc,
UR_APIEXPORT ur_result_t UR_APICALL urUSMPitchedAllocExp(
ur_context_handle_t hContext, ur_device_handle_t hDevice,
const ur_usm_desc_t * /*pUSMDesc*/, ur_usm_pool_handle_t /*pool*/,
size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem,
size_t widthInBytes, size_t height, size_t elementSizeBytes, void *ppMem,
size_t *pResultPitch) {
UR_ASSERT(std::find(hContext->getDevices().begin(),
hContext->getDevices().end(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext,
const ur_usm_desc_t *pUSMDesc,
ur_usm_pool_handle_t pool, size_t widthInBytes,
size_t height, size_t elementSizeBytes,
void **ppMem, size_t *pResultPitch) {
void *ppMem, size_t *pResultPitch) {
UR_ASSERT(hContext && hDevice, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
UR_ASSERT(widthInBytes != 0, UR_RESULT_ERROR_INVALID_USM_SIZE);
UR_ASSERT(ppMem && pResultPitch, UR_RESULT_ERROR_INVALID_NULL_POINTER);
Expand Down

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

4 changes: 2 additions & 2 deletions unified-runtime/source/adapters/mock/ur_mockddi.cpp

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

2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/native_cpu/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPitchedAllocExp(
[[maybe_unused]] const ur_usm_desc_t *pUSMDesc,
[[maybe_unused]] ur_usm_pool_handle_t pool,
[[maybe_unused]] size_t widthInBytes, [[maybe_unused]] size_t height,
[[maybe_unused]] size_t elementSizeBytes, [[maybe_unused]] void **ppMem,
[[maybe_unused]] size_t elementSizeBytes, [[maybe_unused]] void *ppMem,
[[maybe_unused]] size_t *pResultPitch) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/opencl/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPitchedAllocExp(
[[maybe_unused]] const ur_usm_desc_t *pUSMDesc,
[[maybe_unused]] ur_usm_pool_handle_t pool,
[[maybe_unused]] size_t widthInBytes, [[maybe_unused]] size_t height,
[[maybe_unused]] size_t elementSizeBytes, [[maybe_unused]] void **ppMem,
[[maybe_unused]] size_t elementSizeBytes, [[maybe_unused]] void *ppMem,
[[maybe_unused]] size_t *pResultPitch) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand Down

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

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

2 changes: 1 addition & 1 deletion unified-runtime/source/loader/ur_ldrddi.cpp

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

2 changes: 1 addition & 1 deletion unified-runtime/source/loader/ur_libapi.cpp

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

2 changes: 1 addition & 1 deletion unified-runtime/source/ur_api.cpp

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

Loading