Skip to content

[SYCL][Bindless] Fix compiler Werrors #10464

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

Merged
Merged
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
9 changes: 4 additions & 5 deletions sycl/plugins/unified_runtime/ur/adapters/cuda/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ cudaToUrImageChannelFormat(CUarray_format cuda_format,
}
}

ur_result_t urTextureCreate(ur_context_handle_t hContext,
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes the signature of the function, is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is just an internal helper function and we don't need the hContext parameter.

ur_sampler_handle_t hSampler,
ur_result_t urTextureCreate(ur_sampler_handle_t hSampler,
const ur_image_desc_t *pImageDesc,
CUDA_RESOURCE_DESC ResourceDesc,
ur_exp_image_handle_t *phRetImage) {
Expand All @@ -147,7 +146,7 @@ ur_result_t urTextureCreate(ur_context_handle_t hContext,
/// | 1 | filter mode
/// | 0 | normalize coords
CUDA_TEXTURE_DESC ImageTexDesc = {};
CUaddress_mode AddrMode;
CUaddress_mode AddrMode = {};
ur_sampler_addressing_mode_t AddrModeProp = hSampler->getAddressingMode();
if (AddrModeProp == (UR_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE -
UR_SAMPLER_ADDRESSING_MODE_NONE)) {
Expand Down Expand Up @@ -465,8 +464,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp(
return UR_RESULT_ERROR_INVALID_VALUE;
}

UR_CHECK_ERROR(urTextureCreate(hContext, hSampler, pImageDesc,
image_res_desc, phImage));
UR_CHECK_ERROR(
urTextureCreate(hSampler, pImageDesc, image_res_desc, phImage));

auto urMemObj = std::unique_ptr<ur_mem_handle_t_>(new ur_mem_handle_t_{
hContext, (CUarray)hImageMem, (CUtexObject)*phImage, hSampler,
Expand Down