Skip to content

Commit

Permalink
Merge pull request #1406 from wenju-he/urBindlessImagesSampledImageCr…
Browse files Browse the repository at this point in the history
…eateExp-Coverity

[Coverity][L0] Remove overlapping mem copy in urBindlessImagesSampledImageCreateExp
  • Loading branch information
kbenzie authored Mar 12, 2024
2 parents 1f6cbe6 + 2b3d016 commit 93e8469
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions source/adapters/level_zero/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,13 +738,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp(
hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phMem, phImage));

struct combined_sampled_image_handle {
uint64_t raw_image_handle;
uint64_t raw_sampler_handle;
uint64_t RawImageHandle;
uint64_t RawSamplerHandle;
};
combined_sampled_image_handle *sampledImageHandle =
auto *SampledImageHandle =
reinterpret_cast<combined_sampled_image_handle *>(phImage);
sampledImageHandle->raw_image_handle = reinterpret_cast<uint64_t>(*phImage);
sampledImageHandle->raw_sampler_handle =
SampledImageHandle->RawSamplerHandle =
reinterpret_cast<uint64_t>(hSampler->ZeSampler);

return UR_RESULT_SUCCESS;
Expand Down

0 comments on commit 93e8469

Please sign in to comment.